Skip to content

Correct the Readme and Print Example #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,23 @@ Usage Example
.. code-block:: python

import time
import busio
import board
import busio
import adafruit_focaltouch

# Create library object using our Bus I2C port
# Create library object (named "ft") using a Bus I2C port
i2c = busio.I2C(board.SCL, board.SDA)

ft = adafruit_focaltouch.Adafruit_FocalTouch(i2c, debug=True)
ft = adafruit_focaltouch.Adafruit_FocalTouch(i2c, debug=False)

while True:
n = ft.touched
if n:
print(ft.touches)
# if the screen is being touched print the touches
if ft.touched:
print(ft.touches)
else:
print('no touch')

time.sleep(.15)

Contributing
============
Expand Down
13 changes: 9 additions & 4 deletions examples/focaltouch_print_touches.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@
touch driver, over I2C
"""

import time
import busio
import board
import adafruit_focaltouch

# Create library object using our Bus I2C port
# Create library object (named "ft") using a Bus I2C port
i2c = busio.I2C(board.SCL, board.SDA)

ft = adafruit_focaltouch.Adafruit_FocalTouch(i2c, debug=True)
ft = adafruit_focaltouch.Adafruit_FocalTouch(i2c, debug=False)

while True:
n = ft.touched
if n:
# if the screen is being touched print the touches
if ft.touched:
print(ft.touches)
else:
print('no touch')

time.sleep(.15)