MakeCode for Adafruit Boards
|
LED Hockey Puck Code
If you are using the Circuit Playground Express, which uses https://makecode.adafruit.com, click the button below.
If you are using the Circuit Playground Bluefruit, which uses https://maker.makecode.com/, click the button below.
Pair Device and UploadOnce you have the MakeCode program open, click the edit button on the top right to open it in a new MakeCode project. The code blocks and simulator will be ready to modify. Let's get the device paired with WebUSB.
|
on start
if true then
- while true do show animation (rainbow)
if button B is pressed then
while true do
- show animation (purple fireball) for 2ms
else if
- button A is pressed then
- stop all animations
- while button A is press do
- show animation (blue chase) for 5000ms
on button A click
- stop all animations
- While button A was pressed do
- show animation (blue chase color) for 5000 ms
on face down
stop all animations
- run in parallel
- show animation (red orange color) for 5000 ms
- play melody (falling)
on 2g (step)
- play sound (pew pew)
- stop all animation
- show animation (sparkle)
on button A+B click
- reset