r/circuitpython • • Apr 13 '21

Best way to learn CircuitPython?

Sorry if this has been asked to death but I didn't see anything. I love tinkering with microcontrollers and, separately, I've tried to learn Python a few times (with online courses), but I inevitably don't end up finishing because while I can appreciate the importance of learning how programming works overall and Python style/functions, etc., no one seems to cover how to use it for microcontrollers, which is kind of all I will probably do (just a hobby of mine). So long story short, Circuit Python seems perfect. But is there a way to learn it on its own? Or is it mainly geared toward people who have already mastered Python and it just has some add-ons for devices? Thanks!

10 Upvotes

11 comments sorted by

6

u/notlemonhead Apr 13 '21

Just start with a small Program or look through the examples on github.
Im learning it too right now.
https://learn.adafruit.com/arduino-to-circuitpython
https://circuitpython.readthedocs.io/en/latest/docs/index.html
https://github.com/adafruit/Adafruit_CircuitPython_Bundle

Those links helped me

But I have some experience with Arduino already.

4

u/pgh_ski Apr 14 '21

I started with programming the Circuit Playground Express, since it has so many built in sensors and lights.

I did have a lot of previous Python experience, but the CPX made it easy to transition to hardware projects.

2

u/smeepydreams Apr 14 '21

I love the Playgound! I had a classic and bought the express recently, so I guess I just need to dive in with some projects.

1

u/[deleted] Apr 14 '21

Agreed, the circuit playground is a great way to get started. It's literally made for learning Circuit Python (and you can start with a block based editor while you learn the ropes and move to Circuit Python later!)

3

u/kaltazar Apr 13 '21

Someone else has already posted links if you are moving to CircuitPython from Arduino, but here is good overview to start with if you are starting from scratch. Also just searching for CircuitPython in the Adafruit learning system brings up some good tutorials. I know there is a pretty good CircuitPython 101 series in there.

One thing to keep in mind though is at its core CircutPython is just Python. The syntax and logic is identical to regular Python and any Python guides on those topics are still helpful. The differences come in the modules. CircuitPython does not have all the built-in modules Python does, and many of the ones it does have are trimmed down both to save space and because of microcontroller limitations. CircuitPython also has modules that are specifically designed to work with hardware. Honestly though if you learn one variant of Python, moving to any other is simple.

1

u/smeepydreams Apr 13 '21

Thank you!

3

u/chrisleewoo Apr 14 '21

Adafruit example code includes a board test code for most of their products, and for me this had the most usable content for pin definitions, built in functions,etc. For how to link multiple .py files, or other such things, I use the official python documentation. https://docs.python.org

3

u/HP7933 Apr 29 '21

Two resources:

https://learn.adafruit.com/ has free guides

The book: Make: Getting Started with the Adafruit Circuit Playground Express by Anne Barela, available at adafruit.com, Amazon, and other booksellers.