Thursday, February 25, 2010

Task 21 - program to output one led blinking at rate of 200ms that outputs the word "blink" to the screen each time it comes on.

//program to output one led blinking at rate of 200ms that outputs the word "blink" to the screen each time it comes on.
// by Adam Randall

int ledPin = 12;

// The setup() method runs once, when the sketch starts


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


void loop()
{
digitalWrite(ledPin, HIGH); // set the LED on
delay(200);
Serial.println("blink"); // shows the work blink on screen
digitalWrite(ledPin, LOW); // set the LED off
delay(200);


}

No comments:

Post a Comment