So I'm working on an aeroponics project where I want to display certain sensor readouts (temperature and humidity from a DHT11 amongest others) onto a screen but the problem is that when I started using the touchscreen feature the buttons would not respond. I've programmed a home screen which serves as a menu with two buttons which would take the user to the corresponding pages. I have ruled out hardware being a issue because all the examples ran smoothly on the touchscreen and I found out that if I comment out the sensor loops the touchscreen functions work flawlessly with no lags. I'm not really sure why this is the case and I would really appreciate it if anyone can take a look at it ans see what I did wrong! I have uploaded the code below with a picture of the homescreen.
The microcontroller that I'm testing it on is the MEGA2560 and the link to the touchscreen I purchased is below:
April_30th.ino (11.6 KB)
