Saturday, April 30, 2016

Arduino Chapter 1 - LED Blinks

 

This sample is the very basic sample and a basic start for beginner.
Working with led and Arduino to control the way it turns ON(HIGH), OFF(LOW) and Blink.

Requirement
- Genuino/Arduino Board
- 1 LED 3v
- 220Ω resister

Circuit:


Code:
void setup() {
// usedigital pin 13 as an output.
pinMode(13, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(2500); // wait for a second

digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(2500); // wait for a second
}

No comments:
Write comments

Visitors