If you've never used the Circuit Playground Express with MakeCode before, this guide is a good place to start.
To upload code to Circuit Playground Express, follow these instructions:
1) Connect your Circuit Playground Express to your computer using a micro USB cable and press the small reset button in the center of the board. All the LEDs will flash red briefly, then turn green. Your computer should now show a removable drive called CPLAYBOOT.
2) Click the Download button in the code window below to download the .UF2 file to your computer.
3) Now drag and drop the .UF2 file onto the CPLAYBOOT drive in your computer's file explorer or finder.
Once the file is dragged onto CPLAYBOOT the drive will automatically eject itself (your computer may give you a "failed to eject drive correctly" error, you can ignore this). The code is now on your Circuit Playground Express and ready to run!
Note: If you get a drive named CIRCUITPY, no worries! Press the reset button twice to get a flash drive named CPLAYBOOT. The project will not run if copied onto the CIRCUITPY drive as it is for CircuitPython.
If you'd like to play with this code, click Edit in MakeCode and a new window will open in which you can create your own version.
MakeCode is fun to work with and easy to customize, allowing you to get some great results with just a little trial-and-error.
If you'd like to program your fish to swim faster or slower, you can change the number in the
servo write pin A1 block (the further from 90 the faster the servo will spin). You can see in the example below that the fins are programmed to flap quickly when the slide switch on the board is moved right, and move slowly or stop altogether when the switch is moved left.
The rate at which your fish changes color can also be modified by changing the
pause value in the