You can't do .toInt() on a C-string... It's also not a char to int conversion, it's a ASCII to int conversion. And for a single digit it's simple:
char test[] = "3689";
Serial.println(test[0] - '0');
Just subtract the ASCII value for 0 ![]()
You can't do .toInt() on a C-string... It's also not a char to int conversion, it's a ASCII to int conversion. And for a single digit it's simple:
char test[] = "3689";
Serial.println(test[0] - '0');
Just subtract the ASCII value for 0 ![]()