Create cpx-lib-buttons.py
cpx version
This commit is contained in:
parent
5213b70d6d
commit
2cb212cddc
1 changed files with 19 additions and 0 deletions
19
Make_It_Sense/cpx-lib-buttons.py
Normal file
19
Make_It_Sense/cpx-lib-buttons.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
from adafruit_circuitplayground.express import cpx
|
||||
|
||||
while True:
|
||||
if cpx.button_a:
|
||||
cpx.pixels[0] = (0, 30, 0)
|
||||
else:
|
||||
cpx.pixels[0] = (0, 0, 0)
|
||||
|
||||
if cpx.button_b:
|
||||
cpx.pixels[9] = (0, 30, 0)
|
||||
else:
|
||||
cpx.pixels[9] = (0, 0, 0)
|
||||
|
||||
if cpx.switch:
|
||||
cpx.pixels[4] = (0, 0, 30)
|
||||
cpx.pixels[5] = (0, 0, 0)
|
||||
else:
|
||||
cpx.pixels[4] = (0, 0, 0)
|
||||
cpx.pixels[5] = (0, 0, 30)
|
||||
Loading…
Reference in a new issue