Monday, May 3, 2010

Task 19: blinking from 100ms to 1sec.

int ledPin = 13; // LED pin
int del = 100; // Starting Delay

void setup() {
// initialize the digital pin as an output:
pinMode(ledPin, OUTPUT);
}

void loop() {
digitalWrite(ledPin, HIGH); // set the LED on
delay(del); // wait for a second
digitalWrite(ledPin, LOW); // set the LED off
delay(del); // wait for a second
if((del++) == 1001) { del = 100; }
}

No comments:

Post a Comment