更新时间:2021-06-24 15:31:16
coverpage
Title Page
Copyright and Credits
Hands-On Robotics Programming with C++
Dedication
About Packt
Why subscribe?
Packt.com
Contributors
About the author
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Section 1: Getting Started with wiringPi on a Raspberry Pi
Introduction to the Raspberry Pi
Technical requirements
Software required
Hardware requirements
For Raspberry Pi 3B+ and Raspberry Pi Zero W
Additional hardware for Raspberry Pi 3B+
Additional hardware requirements for Raspberry Pi Zero W
Understanding the Raspberry Pi
The Raspberry Pi 3B+
The Raspberry Pi Zero W
Setting up a Raspberry Pi 3B+ as a desktop computer
Installing Raspbian OS on an SD card
Downloading and installing Etcher
Downloading the Raspbian Stretch image
Writing the Raspbian Stretch image to a microSD card
Setting up the Raspberry Pi 3B+
Connecting the Raspberry Pi 3B+ to the internet
Connecting the Raspberry Pi 3B+ to a laptop via Wi-Fi
Creating an SSH file on a microSD card
Connecting the Raspberry Pi 3B+ to a Wi-Fi network using PuTTY
Enabling the VNC server
Viewing the Raspberry Pi output on the VNC Viewer
Increase the VNC's screen resolution
Handling VNC and PuTTY errors
Setting up the Raspberry Pi Zero W as a desktop computer
Setting up the Raspberry Pi Zero W
Connecting the Raspberry Pi Zero W to a laptop via Wi-Fi
Connecting the Raspberry Pi Zero W to a Wi-Fi network using PuTTY
Enabling VNC Viewer for Raspberry Pi Zero W
Viewing Raspberry Pi Zero W output on VNC Viewer
Summary
Questions
Implementing Blink with wiringPi
Installing the wiringPi library in the Raspberry Pi
Accessing Raspberry Pi GPIO pins via wiringPi
Making an LED blink
Wiring connections
The blinking program
Uploading the code to the Raspberry Pi
Smart light – working with digital sensor
The LDR sensor and the way it works
Wiring connection
Smart light program
Pulse Width Modulation using softPWM
How PWM works
The softPWM library
Making an LED blink with the softPWM library
Section 2: Raspberry Pi Robotics
Programming the Robot
Choosing a robot chassis
Constructing and connecting the robot
Constructing the robot
Connecting the motor driver to the Raspberry Pi
What is a motor driver?
Working with H-bridge
Moving the robot
Moving the robot backward
Stopping the robot
Different types of turns
Axial turns
Axial left turn
Axial right turn
Radial turn
Radial left turn
Radial right turn
Building an Obstacle-Avoiding Robot
Using an ultrasonic sensor
How an ultrasonic sensor measures distances
The arithmetic equation for determining the time taken
Wiring the ultrasonic sensor to the Raspberry Pi