Die nächsten Repair Café-Veranstaltungen finden am 28.11., 23.01., 27.02., 27.03. und 24.04. jeweils ab 16 Uhr im Nachbarschaftstreff Vorderer Westen statt (Samuel-Beckett-Anlage 12) Mehr dazu auf repaircafe-ks.de.
(Hier gehts zur deutschen Version) Flipdot member [typ.o] writes: There are more and more affordable TFT displays for Raspberry Pi coming with a resistive touch panel like this from german cheapo - supplier Pollin. I don't wanted to waste a USB connector for the touch input and also I'm planning to use the display with Python in text mode. Because I couldn't find a driver for this usecase I decided to do my own stuff.
Original touch controller with USB to be replaced.
Here you have touch.zip, containing the BASCOM source for the Attiny85, corresponding HEX file, quick and dirty Python test program and lcd.py module containing some VT100 shortcuts. The Attiny is set to 8 Mhz internal RC clock and brownout detection for 2,7 V. It runs nicely with the 3V3 supply of the Pi and therefore doesn't need a level shifter.
Final touch controller on perfboard.
The controller in the first step connects the X-resistor-plane to VCC and GND using port b3 and b1 and then measures the voltage at one terminal of the Y-plane. This A/D-input also is connected to VCC via an internal pullup resistor to acieve a full scale reading if no touch (i.e. no connection between X and Y plane). Afterwards X and Y is swapped and treated accordingly. The controller sends the x,y coordinate as raw A/D-converter values. Calibration and calculation of touched character position is done by the Python script. If you touch the surface of the panel, there will be a "503,220" on the serial line for example. If you remove your finger, the controller will transmit the text "RELEASE". That'sall. KISS.