Friday, November 6, 2009

001 blink [arduino]














void setup(){//this part of code runs only once in the begining.here we setup the system.
pinMode(2,OUTPUT);//we setup PIN 2 as output
}
void loop(){//this sequence will cause blinking.
digitalWrite(2,HIGH);//send +5V to PIN 2
delay(100);//wait for 100 miliseconds
digitalWrite(2,LOW);//turn PIN 2 off
delay(100);//wait for 100 miliseconds
}

No comments:

Post a Comment