- Mount pybox via usb
- Copy circuipython uf2 file inside
/circuitpython
folder - Copy all content inside
/lib
into/CIRCUITPY/lib
, alternatively useinstall.sh
script (only for linux)
Copy src/pybox
into CIRCUITPY/lib
There are six modules in this package:
- led, to manage a single led (internalor external, as a part of ring led strip)
- button, to manage the button
- pot, to manage the potentiometer
- ring, to manage the led ring
- tone, to manage tone production, and send them to the internal speaker
from pybox.led import LED
# choose external led
led = LED('external')
# led on
led.on()
#led off
led.off()
# constructor
led = pybox.led.LED(target='internal')
# on and off
led.on()
led.off()
# toggle: off if led is on and viceversa
led.toggle()
# write a digital value on led (0 or 1) an color it
led.write(1, GREEN)
led.write(0)