I want to grab a number (int) of out a string and use it as address in EEPROM. The code below is not working.
inString = #num2;
char SlotNo = inString.charAt(4); //returns '2'
int S(SlotNo);
EEPROM.write(S, '8');
char value = EEPROM.read(2);
Serial.println(value, BYTE);
I'm pretty sure S is never converted into an 'int' becuase there are no problems when I write
EEPROM.write(2, '8');
If I do a Serial.Print(S), I get '2'. I hope someone can tell me what I'm doing wrong.