2 Getting started

 

This chapter covers

  • Assembling and configuring the core hardware and software of the robot
  • Controlling the Neopixel color and brightness
  • Reading sensor data from the four onboard touch sensors
  • Controlling DC motors with Python
  • Creating your first Python robotics program that interacts with sensors and motors

In this chapter, you will learn how to connect and configure the main hardware and software components used for the robots in this book. Once the hardware and software are set up, we’ll get straight into interacting with the hardware using Python by reading sensor data from the onboard touch sensors. Then, you will learn how to control the Neopixel lights and a DC motor. Finally, all these different hardware components and Python scripts will come together to create a robotics program that controls the Neopixel and DC motors based on touch sensor input.

2.1 Introducing our robotic hardware

Figure 2.1 shows the hardware stack discussed in the previous chapter, with the specific components used in this chapter highlighted in the boxes with darker text. The components with grayed-out text will be used in later chapters.

Figure 2.1 Hardware stack: the Raspberry Pi will handle network communication using Ethernet and Wi-Fi.

2.1.1 Raspberry Pi

2.1.2 Adafruit CRICKIT HAT

2.2 Configuring the software for our robots

2.3 Changing Neopixel colors

2.4 Checking the touch sensor state

2.5 Controlling DC motors

2.6 Controlling motors with the touch sensor

Summary