Not tailored to your needs but below should give you the idea
char cmd = 0;
if (Serial.available() > 0) {
cmd = Serial.read();
}
if (cmd == 'S') {
Serial.println(state);
}
A complex library for a simple problem.
Not tailored to your needs but below should give you the idea
char cmd = 0;
if (Serial.available() > 0) {
cmd = Serial.read();
}
if (cmd == 'S') {
Serial.println(state);
}
A complex library for a simple problem.