Skip to Main Content
BBC Micro:bit in Practice
book

BBC Micro:bit in Practice

by Ashwin Pajankar, Abhishek Sharma, Sandeep Saini
December 2022
Intermediate to advanced content levelIntermediate to advanced
292 pages
5h 45m
English
Packt Publishing
Content preview from BBC Micro:bit in Practice

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) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Official BBC Micro:bit User Guide

The Official BBC Micro:bit User Guide

Gareth Halfacree

Publisher Resources

ISBN: 9781804610121Supplemental Content