Updated and added more button code
This commit is contained in:
parent
7bae534fa7
commit
306ca74c94
2 changed files with 12 additions and 0 deletions
|
|
@ -2,4 +2,5 @@ from adafruit_circuitplayground.express import cpx
|
|||
|
||||
while True:
|
||||
if cpx.button_a:
|
||||
print("Button A pressed!")
|
||||
cpx.red_led = True
|
||||
|
|
|
|||
11
CircuitPython_Made_Easy_On_CPX/cpx_buttons_1_neopixel.py
Normal file
11
CircuitPython_Made_Easy_On_CPX/cpx_buttons_1_neopixel.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
from adafruit_circuitplayground.express import cpx
|
||||
|
||||
cpx.pixels.brightness = 0.3
|
||||
|
||||
while True:
|
||||
if cpx.button_a:
|
||||
cpx.pixels[2] = (0, 255, 0)
|
||||
elif cpx.button_b:
|
||||
cpx.pixels[7] = (0, 0, 255)
|
||||
else:
|
||||
cpx.pixels.fill((0, 0, 0))
|
||||
Loading…
Reference in a new issue