Hi can someone help me, I programmed arduino micro-controller to store a difference of two float values and some sentences in eeprom. But when i read from it i get garbages. Please some one help me how can I do it.?
We can't see your code.
Don't forget the code tags.
I wish to write some sentences too to be displayed to a serial monitor referred from the EEPROM I have not tried that because I dont know how to start writing it there
sketch_may05b.ino (1.59 KB)
What do you mean "sentences"? Do you mean words that a person is expected to read? Do those words change over the lifetime of the program or can you put them all in your sketch source code?
If they don't change then use the F() macro:
Serial.print(F("Please enter a number between 0 and 10: "));
Using this macro will stop those long sentences from occupying precious RAM space.
Thank you MorganS, I found no need of storing the words, but the main problem to me is how can I store an int in eeprom. For example the 'difference' in the attachment, or if i program arduino to generate a password and be used only once. How will it remember in case of suddenly power cut.? I dont want to use a common password as explained in Password.h library.
I've found that the best library to use for reading/writing to Arduino eeprom is EepromUtil. A full explanation and the code can be found here: http://playground.arduino.cc/Code/EepromUtil
Reading/writing integers, floats and text string becomes a breeze.