Introduction
Program the built-in LED Matrix found on the micro:bit and control it with a pushbutton.
We'll explore how we can control the LED Matrix with a single pushbutton.
Video Overview
Featured Document
-
-
We'll use Maker Tape to connect the Button to the Bit Board on a LEGO baseplate.
-
We'll connect our Button to Pin 5 and to Ground (GND).
-
You'll notice the Ground on the Bit Board (as well as the LED and other Crazy Circuits components we'll use) is color coded White.
-
While some components have Polarity our Button does not. If you connect it the other way around it will still work fine.
-
-
-
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 LED Matrix Countdown Timer program: https://makecode.microbit.org/_6iL5HdFPb...
-
Our code will countdown from 5 to 0 and then clear the screen after two seconds.
-
You'll notice that there is a pause of 1000 milliseconds between the numbers decrementing...
-
We'll examine that in the next step.
-
-
-
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.
-
Press the button and you'll see the countdown on the LED Matrix go from 5 down to 0.
-
As mentioned, the code pauses one second between each number change, so we would expect the time between starting at 5 and seeing the 0 appear would be 5 seconds...
-
But we've noticed that when using the LED Matrix the micro:bit tends to run a little bit slower.
-
If you compare this 5 second countdown with a stopwatch or some other time telling device you might notice it takes longer than 5 seconds to complete our countdown.
-
In our tests the 5 second timer tends to take about 8.5 seconds to complete.
-
-
-
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/geFYVuV-DI8
-
