Skip to content

Commit 37eb221

Browse files
committed
Add further button instructions.
1 parent e2e89a0 commit 37eb221

File tree

1 file changed

+11
-1
lines changed
  • CircuitPython_Templates/asyncio

1 file changed

+11
-1
lines changed

CircuitPython_Templates/asyncio/code.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,21 @@
55
"""
66
CircuitPython asyncio example for two NeoPixel rings and one button.
77
REMOVE THIS LINE AND THE REST OF THIS DOCSTRING BEFORE SUBMITTING TO LEARN
8+
THERE ARE TWO POSSIBLE THINGS IN THE CODE TO UPDATE.
89
9-
Update BUTTON to the pin that matches the pin to which the button is connected.
10+
One: Update BUTTON to the pin that matches the pin to which the button is connected.
1011
1112
For example, on the QT Py RP2040, you would leave it as BUTTON to use the built-in Boot button.
13+
On the FunHouse, you would update BUTTON to BUTTON_UP to use the built-in up button.
1214
On the Feather M4 Express, you would wire the external button to A0, and update BUTTON to A0.
15+
16+
Two: THIS IS ONLY NECESSARY IF THE BUILT-IN BUTTON IS ACTIVE HIGH. For example the built-in
17+
buttons on the Circuit Playground Bluefruit and the MagTag are active high.
18+
If your button is ACTIVE HIGH, under "async def monitor_button(button, animation_controls)",
19+
update the following line of code:
20+
with keypad.Keys((button,), value_when_pressed=False, pull=True) as key:
21+
To the following:
22+
with keypad.Keys((button,), value_when_pressed=True, pull=True) as key:
1323
"""
1424
import asyncio
1525
import board

0 commit comments

Comments
 (0)