ilbertt / XPT2046-Python

Python library for XPT2046 Touchscreen
10 stars 5 forks source link

Problem with reading (x,y) #5

Open samedbay opened 1 year ago

samedbay commented 1 year ago

I'm using this display. https://www.waveshare.com/2.8inch-rpi-lcd-a.htm

This doesn't give me the coordinates. I keep receiving None. How can I fix this? print(xpt.get_touch())

ilbertt commented 1 year ago

@samedbay unfortunately, I'm not actively maintaining this library anymore, so I cannot help you. I bet there must have also been a lot of updates to the dependencies over time, so that could be the cause of your problem.

samedbay commented 1 year ago

@Luca8991 Thank you for your response. I was able to get a reading actually, but I am unable to make the interrupt work. Could you explain that part (int_pin) of your code on the xpt2046, if you still remember it? The problem is when I change the irq pin to the pin that is connected to the TS_IRQ, it gives run time error that says failed to add edge detection. It doesn't give that error with random pins. Hence, I don't get a reading from interrupt. I can only get a reading if I call get_touch.

ilbertt commented 1 year ago

I really can't recall that right now. Have you considered reaching out on the micropython-ili9341 repository? In the end, my code was essentially a port of the xpt2046.py file, with a few tweaks to make it compatible with pure Python.