Code it: Create a Test Program
The program on this page will make it so that when you press the micro:bit module’s A button, it tells the HUSKYLENS to learn a color. If you press the B button, it tells the HUSKYLENS to forget everything it learned. If this program works, it proves that the I2C circuit is properly connected.
Hints: Click the cyber:bot extension to find the I2C Repeat… block; it’s near the bottom in the Other section.
- In the MakeCode editor, build the blocks program with the picture below as your guide.
- Use the name field to the right of the Download button to name the project Learn One Color.
- Click the floppy disk Save icon to the right of the name filed to save your work.
- Use the Download button to load the program into the micro:bit.