Hi forum,
While working on a project a faced a problem.
I use a touchscreen as interface to control multple nodes.
The end user should be able to type which node he wants to change.
This works fine for 1-9. But now I faced the follow problem.
How do i make a number like 18, 66, 120?
I mean I cant sum 1+8 cause this will be 9 instand of 18.
Keypad layout:
https://drive.google.com/file/d/0B4n69dT05nvcNUpxeU9VZFV0T3M/view?usp=sharing
My currect code:
while(ok==0){
if ( ctp.touched()) {
TS_Point p = ctp.getPoint();
int px = map(p.x, 0, 240, 240, 0);
int py = map(p.y, 0, 320, 320, 0);
if ((px > 0) && (px < 40) && (py > 260 ) && (py < 290) ) {
result=1;}
if ((px > 40) && (px < 80) && (py > 260 ) && (py < 290) ) {
result=2;}
if ((px > 80) && (px < 120) && (py > 260 ) && (py < 290) ) {
result=3;}
if ((px > 120) && (px < 160) && (py > 260 ) && (py < 290) ) {
result=4;}
if ((px > 160) && (px < 200) && (py > 260 ) && (py < 290) ) {
result=5;}
if ((px > 200) && (px < 240) && (py > 290 ) && (py < 320) ) {
ok=1;}
}
I hope you people are able to help.
Also sorry for mine bad english.
Greets,