File tree Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -59,19 +59,23 @@ Usage Example
59
59
.. code-block :: python
60
60
61
61
import time
62
- import busio
63
62
import board
63
+ import busio
64
64
import adafruit_focaltouch
65
65
66
- # Create library object using our Bus I2C port
66
+ # Create library object (named "ft") using a Bus I2C port
67
67
i2c = busio.I2C(board.SCL , board.SDA )
68
68
69
- ft = adafruit_focaltouch.Adafruit_FocalTouch(i2c, debug = True )
69
+ ft = adafruit_focaltouch.Adafruit_FocalTouch(i2c, debug = False )
70
70
71
71
while True :
72
- n = ft.touched
73
- if n:
74
- print (ft.touches)
72
+ # if the screen is being touched print the touches
73
+ if ft.touched:
74
+ print (ft.touches)
75
+ else :
76
+ print (' no touch' )
77
+
78
+ time.sleep(.15 )
75
79
76
80
Contributing
77
81
============
Original file line number Diff line number Diff line change 3
3
touch driver, over I2C
4
4
"""
5
5
6
+ import time
6
7
import busio
7
8
import board
8
9
import adafruit_focaltouch
9
10
10
- # Create library object using our Bus I2C port
11
+ # Create library object (named "ft") using a Bus I2C port
11
12
i2c = busio .I2C (board .SCL , board .SDA )
12
13
13
- ft = adafruit_focaltouch .Adafruit_FocalTouch (i2c , debug = True )
14
+ ft = adafruit_focaltouch .Adafruit_FocalTouch (i2c , debug = False )
14
15
15
16
while True :
16
- n = ft . touched
17
- if n :
17
+ # if the screen is being touched print the touches
18
+ if ft . touched :
18
19
print (ft .touches )
20
+ else :
21
+ print ('no touch' )
22
+
23
+ time .sleep (.15 )
You can’t perform that action at this time.
0 commit comments