something like this?
unsigned long start = 0;
void setup()
{
pinMode(13, OUTPUT);
Serial.begin(115200);
Serial.println("start");
}
void loop()
{
if (start == 0) // will be true only once ...
{
digitalWrite(13, HIGH);
start = millis();
}
x = analogRead(A0);
Serial.println(x, DEC); // do something with x
delay(1000); // to be tuned
if (millis() - start > 60000L) // are there 60 seconds past after start has been set?
{
digitalWrite(13, LOW);
for(;;);
}
}
Dont compile this code, just read it oud loud and understand what it does.