Notes on Adafruit "Welcome to CircuitPython"
After getting comfortable with the idea of learning CircuitPython, I began reading Adafruit's Welcome to CircuitPython starting guide. I found this to be a great introduction and met my expectation for a document helping beginners get started with CircuitPython. That said, my opinion isn't as good as one coming from an actual beginner! They would be the true test whether Adafruit succeeded.
[UPDATE: I just noticed that there is a lot of overlap between the general welcome guide and information posted under the KB2040 umbrella. However, they're not identical. The KB2040-specific version had no reason to cover CircuitPython Hardware, and the general version lacked some sections like CircuitPython Pins and Modules.]
The most immediate interface point of CircuitPython is that it shows up as a USB file storage device. We just have to put our code in a file named code.py
on the device, and every time we save our changes they will immediately run. This architecture means any device that can edit files on a USB flash drive can be a CircuitPython development tool, and feedback is immediate for instant gratification. This is great for beginner-friendliness! But I'm a grumpy old man set in my ways. I like keeping my source code in a git repository and that means I have to copy my file from my repository to the USB drive. This is probably not a deal breaker and I expect to find a workflow that will work for me, but it did start me on the wrong foot.
While any text editor will work, Adafruit does name Mu as their recommended Python code editor. Advertising itself as a simple Python editor for beginner programmers I thought I would use it at least for the duration of my learning on-ramp. I found it to be a simple straightforward Python editor, supporting not just CircuitPython but also MicroPython and just regular ol' Python on computers. It felt a bit like what Visual Studio Code used to be, before it got all bloated with features. Notably, Mu is not so overly simple that it became infuriating for me to use, which makes it better than Arduino IDE before version 2.0.
Speaking of Arduino IDE idiosyncrasies, I like the fact CircuitPython handles libraries for a project by putting them in a \lib\
subdirectory. I felt this was more straightforward than Arduino's package manager, which always felt more complicated than it needed to be and weighed down by a massive catalog of community contributions.
In comparison, CircuitPython doesn't have as long of a history to build up such a huge library, but Adafruit & contributors have been making great effort covering common needs. Every time I thought of something I might need from a library, a search quickly found one. (The latest: rotaryio
to handle quadrature encoders.) So far, so good! What I need now is a learning project putting CircuitPython to work for me.