What are we going to do?
In this activity we are going to learn a bit more bout micro:bit led matrix. In this activity, students will create programs using coordinates and LEDs. Each of these short exercises demonstrates how to use coordinates to control the LEDs. These programs can then be modified and used in the students’ more complex projects.
- Understand that the 5 x 5 grid of LEDs on the micro:bit represents a coordinate grid with the origin (0,0) in the top left corner.
- Understand that the values of the x coordinates range from 0 through four and increase from left to right.
- Understand that the values of the y coordinates range from 0 through four and increase from top to bottom.
- Learn how to refer to an individual LED by its X and Y coordinates.
- Learn how to plot (turn on) and unplot (turn off) individual LEDs and how to toggle between these two states.
This activity has two parts:
- Smile animation - A short exercise in plotting and toggling LEDs to create a simple animation.
- Brightness - A short exercise in using the brightness settings for the micro:bit LEDs.
Now it's your turn!
Now it's time to start coding on your own! Do you accept these challenges?
Smile animation activity:
- Add a third image to the animation, perhaps a frown face.
- Make your own custom animation! What LEDs stay the same and which need to be toggled?
- Try changing the 25 to 10 or 15, what happens?
- Add another icon and make one fade away, then make the other fade in.
Now that you know how coordinates work, you can try to make animations or even a simple game like this one: dodge ball game. You just have to download it and send it to your micro:bit board.
Important! When using coordinates remember micro:bit's coordinates layout: