Stephen just shared a new tutorial: "Introducing CircuitPython: Adafruit Circuit Playground Express"
CircuitPython is a variant of MicroPython that is designed with ease of use and simplicity in mind, and it works great with the Adafruit Circuit Playground Express. CircuitPython is based on the very popular Python programming language, they have jus…
Read more
Hey thanks for this. Totally new to circuitry but not to python (I know basics).
Just got started with the circuit playground, I copy pasted the code and I get:
Traceback (most recent call last):
File “main.py”, line 5, in
File “neopixel.py”, line 91, in init
ValueError: Pin PB23 in use
EDIT 1:
PB23 being neopixel something or other according to: https://cdn-learn.adafruit.com/assets/assets/000/049/780/original/Adafruit_Circuit_Playground_Express_Pinout.pdf
EDIT 2:
It’s something about when cpx is imported. When I don’t import cpx, this error does not appear.
Not sure what to make of that because I’m a total newb.
Of course it didn’t work the first time, right?
Hi Jordan,
Adafruit updated their core libraries and we have some tidying up to do within our tutorials. @Stephen is back on Monday coming, we’ll go through and fix up some code soon after!
Thanks Graham.
I updated the post with some further findings.
It is the same error and situation with the accelerometer tutorial as well (which is really what I’m interested in).
Great work, however! Very appreciative that you guys have provided this.
Hey Jordan,
I’ve updated this tutorial so it now works with version 3x. I’ve got to work through all the Tutorials and update them, but I’ll do the accelerometer one next!
This is called “being a boss.”
Thank you Stephen. And I’m sure the information I gave was invaluable in the update of the code
Thanks again!
Jordan
Well we may not have noticed if you didn’t say something so I’d say that’s pretty invaluable!
Hey Jordan,
I’ve updated the accelerometer tutorial to reflect the newest version. If you get ahead of me for any of the other circuitPython tutorials. Just removed theses lines:
import neopixel
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=.2)
and change every instance of “pixels” to “cpx.pixels” and it should work.
If you want to set the brightness use:
cpx.pixels.brightness = .x
CircuitPython (like MicroPython from which it determines) is executed in C. While generally unique and unmistakably more mind boggling than a commonplace Arduino sketch, it’s as yet a similar language; on the off chance that you are agreeable work in C/C++ with regards to Arduino, CircuitPython internals should look to some degree natural. While the facts demonstrate that we can do practically anything in Python, there are an assortment of reasons we should execute a module in C as a component of the virtual machine.
We’re coming up short on RAM for our Python code
We have some code that requirements to run quicker
We have some C code that we need to utilize.
We need better, more straightforward command over certain parts of the equipment.
We have some usefulness that is central to the point, that we generally need it accessible. digitalio is a prime case of this.
Hey,
I’m not overly sure what your question is, though if you are looking for gear that more-naturally works with C, then perhaps consider Teensy.