Art

Teaching

Studies

Samfundsdebat

Diverse

ěkologi


Pub


Internal Portal





edit



Printable View

Atme

Wiring?

Simpelt loop til at blinke test-LEDen:

int ledPin = 48;
int value = LOW;
long previousMillis = 0;
long blinkInterval = 1000;

void setup()
{
 pinMode(ledPin, OUTPUT);
}

void loop()
{
 handleBlinking();
}

void handleBlinking() {
 if (millis() - previousMillis > blinkInterval) {
   previousMillis = millis();

   if (value == LOW) {
     value = HIGH;
   } else {
     value = LOW;
   }

   digitalWrite(ledPin, value);
 }
}
Page last modified on September 30, 2006, at 05:13 PM