Imported from GitHub: pythoninabox/pybox2 · commit 7b9cd22 · license GPL-2.0
Description
rp2040-zero
README
python in a box (pybox)
circuitpython installation
- Mount pybox via usb
- Copy circuipython uf2 file inside
/circuitpythonfolder - Copy all content inside
/libinto/CIRCUITPY/lib, alternatively useinstall.shscript (only for linux)
Upgrade pybox package
Copy src/pybox into CIRCUITPY/lib
Simple Usage
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
led module
example:
from pybox.led import LED
# choose external led
led = LED('external')
# led on
led.on()
#led off
led.off()
api
# 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)
No comments yet. Be the first to ask about this board.