REXduino 4-wire touchscreen
Hi, I would like to measure the position on the 4-wire touch screen. For this I have to switch A0, A1, A2, A3 between analog input and digital output. Is it possible in REXduino?
This is code for Arduino and I would like to implement in REXduino.
int X,Y; //Touch Coordinates are stored in X,Y variable pinMode(Y1,INPUT); pinMode(Y2,INPUT); digitalWrite(Y2,LOW); pinMode(X1,OUTPUT); digitalWrite(X1,HIGH); pinMode(X2,OUTPUT); digitalWrite(X2,LOW); X = (analogRead(Y1))/(1024/Xresolution); //Reads X axis touch position pinMode(X1,INPUT); pinMode(X2,INPUT); digitalWrite(X2,LOW); pinMode(Y1,OUTPUT); digitalWrite(Y1,HIGH); pinMode(Y2,OUTPUT); digitalWrite(Y2,LOW); Y = (analogRead(X1))/(1024/Yresolution); //Reads Y axis touch position```
cechurat last edited by
Thanks for reaching out. In general, it is possible.
However, you would need to edit the sketch for REXduino in order to read out the touch position and communicate it to REXYGEN which could be pretty challenging (depending on your programming skills). It would require knowledge of the REXduino communication mechanism which is not documented (except the code).
What about posting the touch position information via REST API to REXYGEN? Example "0302-11 ESP8266 REST API" might be used as a hint.