/*
* Project: Blink2-task 21
* Author: Jane-Maree Howard
* Date: Monday 08/03/2010
* Platform: Arduino 18
* Purpose: To demonstrate blink time for external LED & writing to the Serial Monitor (SM)
* Operation: Sets up output pin in setup() method;
* Declares pin definition variable;
* Sets up output to serial port & thus to SM;
* The LED blinks & the word "Blink" is written to the SM @ each blink..
* & repeat
*/
int redLedPin = 11; // red LED connected to digital pin 11
int dLay = 1000; // delay variable
// The setup() method runs once, when the sketch starts
void setup()
{
//Now open the serial port..
Serial.begin(9600); // ..& set data transmission rate to SM at 9600Baud
// initialize digital pin 11 as output
pinMode(redLedPin, OUTPUT);
}//end setup()
// Loop turns red LED (pin 11) on, prints the word "Blink" to the SM,
// waits one second, turns red LED off, waits one second &..
// ..repeats endlessly while Arduino has power
void loop()
{
digitalWrite(redLedPin, HIGH); // turn red LED on
Serial.println("Blink"); // print to SM
delay(200); // delay 200 milliseconds
digitalWrite(redLedPin, LOW); // then turn red LED off
delay(200); // delay 200 milliseconds
}//end loop()
08 March 2010
Subscribe to:
Post Comments (Atom)
Aha! the Serial Monitor DOES work! It didn't last time i tried it..
ReplyDelete..NO, it doesn't wait one second, it waits 200 milliseconds!!
ReplyDeleteAt least that's what the software does, even if the comments are a bit astray...