Hello everyone! I've got a problem and i would like your help.
I've got a very simple source code:
void loop() {
cData = 0;
while( cData <= 50 ){
// read the analog in value:
tempSensorValue = analogRead(analogInPin0);
Serial.print("T");
Serial.print(tempSensorValue);
Serial.print("-");
humdSensorValue = analogRead(analogInPin1);
Serial.print("H");
Serial.print(tempSensorValue);
Serial.print("-");
cData++;
}
delay(1000);
}
And i want a function which retrieve preseted store inforemations from EEPROM like location,an ID etc.
Here is the function:
void __read_EEPROM( ) {
_addrByte = 0;
String str;
int value;
while( value != 255 ) {
value = EEPROM.read( _addrByte );
if( value == 0 ) {
break;
}
str += (char)(value);
_addrByte++;
}
Serial.print(str);
}
This two parts of code are the most important for an interface C# application.
My question:
Ok i'm reading data like temperature and others too, but i want with some way to retrieve this informations from eeprom whenever i want.
without any confuse on my data.
e.g See below:
void loop() {
cData = 0;
while( cData <= 50 ){
// read the analog in value:
tempSensorValue = analogRead(analogInPin0);
Serial.print("T");
Serial.print(tempSensorValue);
Serial.print("-");
humdSensorValue = analogRead(analogInPin1);
Serial.print("H");
Serial.print(tempSensorValue);
Serial.print("-");
cData++;
}
delay(1000);
/* if( Serial.available() > 0 ) {
char choice = (char)Serial.read();
__read_EEPROM();
}
else
{
continue;
} */
}
How to do something like that??
Attention: i'm reading for the 1st second 50 values, This is a continuesly job, because i create realtime graphs in C#, so i can't stop the values retrieving.