LED BLINKING
Hello Friends ,
I am Cyberautics and in this session we write the first code of LED Blinking in Arduino which is very simple and very Basic program of the Arduino, In this blog I recommend Arduino uno but you can use any Arduino (nano, mega, etc).
COMPONENTS
- Arduino UNO
- LED
- Resistor- 220 ohm
- jumper wire
- Bread Board/PCB
- PC/Laptop/Mobile
- Arduino IDE
SCHEMATIC DIAGRAM
This is the basic diagram of the connection on the Breadboard with the Arduino board as per the diagram we have to connect all the peripherals(led, resistor etc).
CODE
//make a connection as per diagram
int led=13; //define a led pin
void setup()
{
//configure LED as a output
pinMode(led, OUTPUT);
//configure a serial monitor,(9600 ) is a baud rate
Serial.begin(9600);
}
void loop()
{
digitalWrite(led, HIGH); //make a LED on
delay(1000); //set delay
digitalWrite(led, LOW); // make LED off
delay(1000); //set delay
Serial.println("LED"); // output of serial monitor
}
//check an output in your LED
//we can check it in serial monitor
EXPLANATION
so, Friends first of all we have to make connections as per given diagram, then paste this code in arduino IDE.
First compile the code and then if successfully compiled then upload the code in your Arduino board.
when this code is running the inbuilt arduino LED will blink with 1 second of delay,by the use of serial monitorng feature we can monitor the pulse just click in to your serial monitor icon which is already fix in arduino IDE , just click on it and enjoy.
Your output on serial monitor looking like upper image.
so, my dear friends I hope this information is useful if you have any query or questions you can mail me on techblog313@gmail.com.
Superb
ReplyDeleteThank you
DeleteCool
ReplyDeleteThanks
Delete