unsigned long pastmil;
const int blink = 1000;
int ledstate = LOW;
const int blinkpin = 7;
void setup() {
pinMode(blinkpin, OUTPUT);
}
void loop() {
unsigned long currentmil = millis();
if (currentmil - pastmil >= blink) {
pastmil = currentmil;
if (ledstate == LOW) {
ledstate = HIGH;
}
else
{
ledstate = LOW;
}
digitalWrite(blinkpin, ledstate);
}
}