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

9

Working with Analog Input and PWM

In the previous chapter, we learned how to work with the files stored on Micro:bit using MicroPython.

This chapter will explore how to use analog components and interface them to analog pins on the Micro:bit. We will also explore using various analog devices, such as a potentiometer, a joystick, a Pulse-Width Modulation (PWM) signal, a servo, a photoresistor, and various functions supported by Micro:bit for analog applications.

In this chapter, we will cover the following topics:

  • Micro:bit analog pins
  • Potentiometers
  • Photoresistors
  • PWM signals
  • Servo motors using PWM
  • Handling multiple analog devices
  • PWM using RGB LED
  • Joysticks

Let’s explore the analog input and PWM with Micro:bit and MicroPython.

Technical ...

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