I am trying to write to EEPROM the value 999 , read it back and multiply it by 1000. I expect to get 999,000 but instead I get 15960. The code is below. Where is it going wrong ?
The code works fine for upto Value = 65 and Big returns 65000. But I thought since I have declared Big as an unsigned int, there should be no problem for values above 65000 also?
#include <EEPROM.h>
unsigned int Value =999;
unsigned long Big ;
void setup(){
Serial.begin(9600);
int eeAddress = 100; //Location we want the data to be put.
EEPROM.put( eeAddress, Value );
Value = 0;
EEPROM.get( eeAddress, Value);
Serial.println (Value);
Big = Value * 1000;
Serial.println( Big);
}
void loop(){ /* Empty loop */ }