Skip to content

Commit 306ca74

Browse files
committed
Updated and added more button code
1 parent 7bae534 commit 306ca74

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CircuitPython_Made_Easy_On_CPX/cpx_button_a.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
while True:
44
if cpx.button_a:
5+
print("Button A pressed!")
56
cpx.red_led = True
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from adafruit_circuitplayground.express import cpx
2+
3+
cpx.pixels.brightness = 0.3
4+
5+
while True:
6+
if cpx.button_a:
7+
cpx.pixels[2] = (0, 255, 0)
8+
elif cpx.button_b:
9+
cpx.pixels[7] = (0, 0, 255)
10+
else:
11+
cpx.pixels.fill((0, 0, 0))

0 commit comments

Comments
 (0)