Updated and added more button code

This commit is contained in:
Kattni Rembor 2018-05-27 18:29:22 -04:00
parent 7bae534fa7
commit 306ca74c94
2 changed files with 12 additions and 0 deletions

View file

@ -2,4 +2,5 @@ from adafruit_circuitplayground.express import cpx
while True:
if cpx.button_a:
print("Button A pressed!")
cpx.red_led = True

View 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))