I'm trying to convert the char '1' to the integer 1 and having trouble. The following code:
void setup() {
Serial.begin(115200);
}
void loop() {
char a = '1';
int b = (int)a;
Serial.println(a);
Serial.println(b);
Serial.println("---");
delay(1000);
}
Produces:
1
49
Any tips on converting the char '1' to the integer 1?
Thanks for any help.