void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
static unsigned long lastTime = 0;
if (lastTime + 1000 < millis()) {
Serial.print("Arduinoen har vært på i ");
unsigned int seconds = millis()/1000;
Serial.print(seconds);
if (seconds > 1) {
Serial.println(" Sekunder");
} else {
Serial.println(" Sekund");
}
lastTime += 1000;
}
}