Kyle Chuang | ME405 Mechatronics Portfolio
tch_driver.py File Reference

Lab0x07. More...

Classes

class  tch_driver.touchscreen
 

Variables

 tch_driver.xp = Pin.cpu.A0
 
 tch_driver.xm = Pin.cpu.A6
 
 tch_driver.yp = Pin.cpu.A7
 
 tch_driver.ym = Pin.cpu.A1
 
float tch_driver.w = 0.100
 
float tch_driver.l = 0.176
 
float tch_driver.xc = l/2
 
float tch_driver.yc = w/2
 
 tch_driver.ts = touchscreen(xp, xm, yp, ym, w, l, xc, yc)
 

Detailed Description

Lab0x07.

I wrote this code as a driver file for an 8" TFT LCD Touchscreen. It contains 4 methods which track the coordinates of any input to the touchscreen:

  1. Xscan(): Returns the X coordinate of the input to the touchscreen. If there is no X input, then it returns None.
  2. Yscan(): Returns the Y coordinate of the input to the touchscreen. If there is no Y input, then it returns None.
  3. Zscan(): Returns a boolean output which measures if there is an input to the touchscreen. (1 = no input, 0 = input).
  4. coord(): Returns the touch input as a coordinate system and the response time. Returns in the format: (X, Y, Z), time [us].
Note
Unit system of the length inputs must be consistent!
Author
Kyle Chuang
Date
March 2, 2021