This is the simplest code when coding with an Arduino. It has an internal LED which is connected on pin 13, and is always configured by default; it blinks at an interval of 1 second; this is basically a short code ‘telling’ the LED to light for 1000ms(micro-seconds) then turn off for another 1000ms; it is defined by a loop function which keeps the LED turning on and off thus simulating the ‘Blinking’ effect.
- Arduino Uno
- 220 ohm resistor(optional)
The long leg of the led(which is the anode) is connected to a 220 ohm resistor which is connected into digital pin 13 while the short leg of the led (which is the Cathode) is connected to the ground (GND).
After you build the circuit plug your Arduino or Genuino board into your computer, start the Arduino Software (IDE) and enter the [CODE]
You may also load it from the menu File/Examples/01.Basics/Blink . The first thing you do is to initialize pin 13 as an output pin with the line
In the main loop, you turn the LED on with the line:
This supplies 5 volts to pin 13. That creates a voltage difference across the pins of the LED, and lights it up. Then you turn it off with the line:
That takes pin 13 back to 0 volts, and turns the LED off. In between the on and the off, you want enough time for a person to see the change, so the delay() commands tell the board to do nothing for 1000 milliseconds, or one second. When you use the delay() command, nothing else happens for that amount of time.
To get your hands on an Arduino Board and Various Project Components just contact us
Phone Number : +2547-16806025
Email : email@example.com
A short example of the code:
For More information visit www.arduino.cc