Simple test

Ensure your device works with this simple test.

examples/stmpe610_simpletest.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import busio
import board
import digitalio
from adafruit_stmpe610 import Adafruit_STMPE610_SPI

spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
cs = digitalio.DigitalInOut(board.D6)
st = Adafruit_STMPE610_SPI(spi, cs)

print("Go Ahead - Touch the Screen - Make My Day!")
while True:
    if not st.buffer_empty:
        print(st.read_data())