File tree Expand file tree Collapse file tree
Introducing_CircuitPlaygroundExpress Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # CircuitPlaygroundExpress_CapTouch
1+ # Circuit Playground Capacitive Touch
22
33import time
4-
54import board
65import touchio
76
8- touch1 = touchio .TouchIn (board .A1 )
9- touch2 = touchio .TouchIn (board .A2 )
10- touch3 = touchio .TouchIn (board .A3 )
11- touch4 = touchio .TouchIn (board .A4 )
12- touch5 = touchio .TouchIn (board .A5 )
13- touch6 = touchio .TouchIn (board .A6 )
14- touch7 = touchio .TouchIn (board .A7 )
7+ touch_A1 = touchio .TouchIn (board .A1 )
8+ touch_A2 = touchio .TouchIn (board .A2 )
9+ touch_A3 = touchio .TouchIn (board .A3 )
10+ touch_A4 = touchio .TouchIn (board .A4 )
11+ touch_A5 = touchio .TouchIn (board .A5 )
12+ touch_A6 = touchio .TouchIn (board .A6 )
13+ touch_TX = touchio .TouchIn (board .TX )
1514
1615while True :
17- if touch1 .value :
16+ if touch_A1 .value :
1817 print ("A1 touched!" )
19- if touch2 .value :
18+ if touch_A2 .value :
2019 print ("A2 touched!" )
21- if touch3 .value :
20+ if touch_A3 .value :
2221 print ("A3 touched!" )
23- if touch4 .value :
22+ if touch_A4 .value :
2423 print ("A4 touched!" )
25- if touch5 .value :
24+ if touch_A5 .value :
2625 print ("A5 touched!" )
27- if touch6 .value :
26+ if touch_A6 .value :
2827 print ("A6 touched!" )
29- if touch7 .value :
30- print ("A7 touched!" )
28+ if touch_TX .value :
29+ print ("TX touched!" )
3130
3231 time .sleep (0.01 )
You can’t perform that action at this time.
0 commit comments