Our friends at the Mu blog have posted a great project: Keith has created a colourful and noisy project with Mu and an Adafruit Circuit Playground Express (CPX) board. Just what you need for the 4th July!
By day Keith is a healthcare informatics professional. By night, like many of us, he builds robots and other Maker-type projects. This particular project blinks different messages in Morse code. You can configure the LED colour as well as toggle the buzzer (so the board “bloops” Morse code too).
He says, “I love the idea that I could use Python to program a microcontroller” and explains the origin of the project as follows:
I was at the San Mateo Maker Faire this year (I was at the first one, and have been there or NYC Maker Faire every year since). I had brought the CPE with me to play with in case I had any free time (I hadn’t had time to really mess with it – big project at work). My flight Sunday night was cancelled, so I thought I might go to the Bring-a-Hack event. I didn’t want to show up empty handed, but all I could think up was a lame demo of the CPE. I quickly re-reviewed some tutorials, and wrote a quick program in my hotel room. Didn’t work at all. Tried different things, cut-and-paste sample code (which all worked), finally gave up. At that point I was tired, and had to get up early for a flight, so I canned it. When I got back to St. Louis and read through the code again, I realized I had thought that time.sleep was in milliseconds (like Arduino Delay), rather than in seconds. The original code I had written was actually fine – just a thousand times slower than I was expecting. Once I fixed that, it was fine. I’ve since cleaned it up a little.
The project’s source code contains a complete implementation of a Morse code transmitter that could form the basis for many future beginner-friendly projects.
As for Mu, Keith says it is, “certainly convenient for programming the CPX (and BBC micro:bit). The biggest thing I miss is a keyboard shortcut to comment/uncomment bits of code. That would make troubleshooting so much faster.” Check out progress for this feature request on our issue tracker.
Do you have a July 4th themed project? Let us know in the comments!