Greetings. I am using the PS2 library with a TFT on my Arduino mega. During one part of my program, I am trying to get the Arduino to recognize a SINGLE keystroke. Specifically, when I type the letter "T" it does something, and when I type the letter "S" it does something, and if I type any other key it does not affect anything and continues on with what it was doing before. Here is a snippet of my code:
if (keyboard.read() == s) {
//Do situation A
} else if (c == t) {
//Do situation B
}
else {
//Continue with the default (Situation C)
}
Oh, and also important, way back in the start of my code I have this line of code telling the arduino that "c" is the keystroke.
char c = keyboard.read();
But, when I run my code, I get this error:
's' was not declared in this scope
What I assume is that the Arduino thinks that S is like another char, when I want it to literally be S!