i am little bit confused about SRAM, EEPROM and Flash memory. My sketch is saved in Flash memory whcih is 32k (arduino uni). when I need SRAM and EEPROM to use?
This is the page for the Arduino Uno board http://arduino.cc/en/Main/arduinoBoardUno
Flash Memory 32 KB (ATmega328) SRAM 2 KB (ATmega328) EEPROM 1 KB (ATmega328)
The code of the sketch is stored in Flash. The variables are stored in SRAM (I call it 'ram').
For example, these variables are stored in ram:
int i; float temperature;
If you write a sketch and use the variables, the code (in flash) uses the variables (in ram). Calling the function, and the calculation is in Flash. But the parameters of the function and the variables are in ram.
i = analogRead(0); temperature = i * 100.0 / 5.0;
An EEPROM is something extra. It is like an extra device inside the Arduino. EEPROM keeps its value if the power is turned off. The EEPROM would typically be used to store settings. When the Arduino is turned on it could read those settings. http://en.wikipedia.org/wiki/EEPROM
ADDED: The question was already answered in a crosspost: http://forum.arduino.cc/index.php?topic=167513.msg1247502
Do not cross post. It is very bad manners!!
Grumpy_Mike: Do not cross post. It is very bad manners!!
Sorry Sir, I thinked that my Question is related to Microcontroller Community. Now i will pin it in my mind while posting. Thanks for Guidance