I'm using Arduino for a project in working on for school. I am not too familiar with coding in Arduino. My question is how would I input code to record for 10 seconds only. I'm using an example code for a barometric sensor that measures temperature, pressure, and altitude. The code includes uses the delay function. Is there a way I can make the code run for 10 seconds only. Because the serial monitor continuously runs.
post the code ! tip: whatever happens in loop() keeps happening, whatever happens in setup() happens only once, this modified 'blink' example should clarify it
void setup() {
pinMode(13, OUTPUT);
for (int count=0; count<10; count++) {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
}
void loop() {
}