I have a PC based App send in some data to my MEGA 2560 via Serial 1.
All good there and I am getting this into the MCU and then storing to EEPROM. The sample data is as below :
<C,1000,PU,4375,200,9375,HL,4375,400,0,PD,2500,200,9375,HL,2500,400,0,NU,625,200,9375,HL,625,400,0,ND,2500,200,9375,HL,2500,400,0,E>
Now I have defined the EEPROM storage space as all “int “ variables. So when I read back I am reading all numeric perfectly, but the Characters like C, PU etc are just reading zero. How to get the characters right.
For information I have given the code that stores the received characters on to the EEPROM below. I am not sure if this code needs to be corrected ?
while ((parsedMsg = strtok(NULL, ",")) != NULL) {
editParam[paramCount] = atoi(parsedMsg);
paramData = editParam[paramCount]; // paramData has now the next data in the array
EEPROM.put(eeAddress, paramData); // Save it to EEPROM
eeAddress += sizeof(int); // Incrememnt for the next data
paramCount = paramCount + 1;
}