This code creates a python class which can read the position on a resistive touch pad. More...
Classes | |
class | TouchPanelDriver.touchy |
Allows the user to read x, y, and z position on a touch panel. More... | |
Variables | |
TouchPanelDriver.tim = pyb.Timer(2, prescaler = 79, period = 0x7FFFFFFF) | |
Timer used to test scanning speeds. | |
This code creates a python class which can read the position on a resistive touch pad.
It contains a constructor which allows the user to select four abritrary pins representing xp, xm, yp,ym as well as the width and length of the resistive touch panel and the coordinate representing the center of the resisitve touch panel. In addition, it contains 3 methods which scan and return the postion of the X,Y,and Z components, respectively. Finally, this class contains a method which reads all 3 components and returns their values as a tuple. Every channel read takes less than 500us.