Monday, May 3, 2010

Task 21: Blink with Serial output

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

void setup() {
// initialize the digital pin as an output:
pinMode(ledPin, OUTPUT);
Serial.begin(9600); // Start serial connection
Serial.println('Ready'); // let the human know the machine is ready
}

void loop() {
Serial.println('Blink'); write to the serial port
digitalWrite(ledPin, HIGH); // set the LED on
delay(del);
digitalWrite(ledPin, LOW); // set the LED off
delay(del);
}

No comments:

Post a Comment