Introduction
Connect a potentiometer to a Bit Board and control the micro:bit's built-in LED matrix.
We'll explore how we can use a potentiometer as an input for the micro:bit
Video Overview
Featured Document
-
-
We'll use Maker Tape to connect the Potentiometer to the Bit Board on a LEGO baseplate.
-
We'll need to connect one side of the Potentiometer to Ground (GND) and the other side to 3.3v
-
We will then connect the center of the Potentiometer to Pin 0. (Note that Pin 0 is an analog pin, which we'll need for the Potentiometer.)
-
The other analog pins are 1, 2, 3, 4, and 10. See this chart for a pinout diagram: https://makecode.microbit.org/device/pin...
-
You'll notice the Ground on the Bit Board is color coded White.
-
The 3.3v hole on the Bit Board is labeled and is actually two holes right next to each other on the Bit Board. (There is a small line showing the connection between them.)
-
-
-
If you've never used a micro:bit before you'll want to check out this guide: Bit Board V2 Setup and Use
-
We're going to load the following code for our Potentiometer Number program: https://makecode.microbit.org/_LR9AMX1Hh...
-
This is some simple code! It will just use the built-in LED matrix on the micro:bit to display the value from the Potentiometer.
-
-
-
Once the code is loaded it should start running immediately.
-
You can power the micro:bit via the USB cable you used to load the code or you can use a battery pack plugged into the Bit Board.
-
Turn the small blue knob on the Potentiometer and you'll see numbers scrolling across the LED matrix.
-
We'll be honest... it's not ideal! Since the values range from 0 to 1023 any number that is not a single digit will scroll across the LED matrix.
-
Turn the knob all the way anti-clockwise and see if a zero appears. Then turn it very slowly clockwise to see the numbers increase.
-
Don't worry, we'll work within the limitations of the LED matrix in the next guide!
-
-
-
Follow along with our recorded Live Stream!
-
You can watch the full video of us walking through this project, along with explaining and exploring the code: https://youtube.com/live/jN7oP8TrU8k
-
