7

Programming External Push Buttons, Buzzers, and Stepper Motors

In the previous chapter, we worked with LEDs, seven segments, and their related components, observing them with the help of examples.

This chapter will explore using components such as switches, buzzers, and motors. We will explore their working principles and applications using the MicroPython programs and the Micro:bit. After completing this chapter, you will know how to use the following components:

  • Push buttons
  • Slide switches
  • Buzzers
  • Stepper motors

Let us get started by learning how to program these components.

Technical requirements

For this chapter, we will need the following hardware products:

  • Push buttons
  • LEDs
  • A buzzer
  • A stepper motor 28BYJ-48 and driver board (ULN2003A) ...

Get BBC Micro:bit in Practice now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.