I'm a newbie to programming in general. Trying to get this touchscreen by Reachtech going. It basically has it's own controller for storing and executing macros that I saved as xxxx.h files. These files can be called out uisng the command: <index #>. I've connected the screen's rs232 port to a max232 shield that's connected to arduino mega ---> pc.
According to the screen manual, each button press should return: r<index#>. The serial monitor spits out 3 number terms. I translated it with the table and in fact the data is correct. Now i just need a way to see it in readable terms so i can come up with some quick if/else statements for screen selection.
Here's the code:
#include <SoftwareSerial.h>
void setup()
{
Serial1.begin(115200);
Serial.begin(9600);
Serial1.print('\r');
Serial1.print('\r');
Serial1.print('\r');
Serial.println("Showing debug");
Serial1.println("bvs 50");
}
int i=1;
int ByteReceived;
void handle_button(void);
#undef SHOW_DEBUG
#ifdef SHOW_DEBUG
// these are undefined if SHOW_DEBUG is undefined,
// otherwise may be defined or not as needed
#define BUTTON_PRESS_DEBUG
#endif
void loop()
{
while (i==1){
Serial.println("Showing debug");
Serial1.println("z");
Serial1.println("m1");
i++;
}
if (Serial1.available() > 0)
{
ByteReceived = Serial1.read();
Serial.println(ByteReceived);
}
}
Serial monitor:
Showing debug
Showing debug
62
13
62
13
62
13
62
13
62
13
62
13
114
49
13
114
50
13
114
51
13
114
51
13
114
51
13
114
49
13
114
49
13
114
49
13
Any help would be appreciated. Go easy on the noob