Hi -
I have created a Simon game to where I am writing the high score to the eeprom (the high score is the number of rounds a user makes it though). I have not had a problem creating the code to store the data:
if (turn > highscore)
{
highscore = turn;
EEPROM.write(0, highscore); //write highscore to eeprom
}
The data is being stored correctly. the problem is when I go to display the data on my Parallax LCD (27977-RT). The code I have written is displaying the ASCII character, not the number that is stored.
void displayhighscore() {
highscore = EEPROM.read(0);
mySerial.write(12); //clear display
mySerial.print(" High Score is"); // First line
mySerial.write(13); // Form feed
mySerial.print(" ");
mySerial.write (highscore);
mySerial.print(" rounds"); // Second line
delay(3000);
mySerial.write(12); // Clear
mySerial.print("Here we go..."); // First line
mySerial.write(13); // Form feed
delay(1000);
}
In other words, if the stored number in memory address is 58, the parallax displays the ":" symbol (this is the ASCII chr value for 58).
I have tried many variations using the INT , CHR and other commands but can't seem to get "58" to display on the Parallax.
Since I'm new to Arduino I'm sure I am making a rookie mistake. Can someone help?