I have a need to record the high and low points of a sensor during the first 10 seconds.
from startup to 5 seconds the sensor will be driven low and from 5 to 10 seconds it will be driven high.
I want to return these 2 values.
i tried the following code but it doesnt seem to work. Am I doing something wrong? probably....
while (millis() < 5000) {
sampleLow = analogRead(0);
// wait a second so as not to send massive amounts of data
delay(1000);
Serial.print(sampleLow);
Serial.println(" ");
}
while (millis() < 10000) {
sampleHigh = analogRead(0);
// wait a second so as not to send massive amounts of data
delay(1000);
Serial.print(sampleHigh);
Serial.println(" ");
}