Hello, I'm working on a project with arduino leonardo, which sent a sentence trougth the serial port and get an int variable that I use in "keyboard.write" for example "Keyboard.write (125)," In theory according to table would have to print the ascii character "}" but prints "*". but works well with letters, numbers and the "modifier keystrokes" Any idea what could be happening?
Here is some code:
while (Serial.available()) //Sumo uno tras otro los caracteres seriales y creo una string.
{
delay(3); //delay to allow buffer to fill
if (Serial.available() >0) {
char c = Serial.read(); //gets one byte from serial buffer
readString += c; //makes the string readString
}
if(readString.startsWith("KW")) //KwyWrite, preciona una tecla y la suelta inmediatamente. ejemplo KW065 o KP65
{
String KeyStrokevalue = readString.substring(2, readString.length()); //Obtengo el valor del KeyStroke
Serial.println(KeyStrokevalue.toInt());
Keyboard.write(KeyStrokevalue.toInt());
readString="";
}