Basic Arduino Programming (LED Blink)
What is Arduino
- Arduino is an open source electronic platform which is easy to use in case of hardware and software.
- Arduino boards are able to read inputs in the form of a program/code to interact with respective connected devices.
Single LED Blink Circuit
Hardware Required
- Breadboard
- Arduino board
- Jumper wires
- LED
- 220ohm resistor
- Arduino code transfer cable
Connections
- Connect the LED to the breadboard
- Further, connect one terminal of the resistor to the LED and another terminal of the resistor is connected anywhere on the breadboard.
- Connect one terminal of the male to male jumper wire to GND (ground) and another to the second terminal of the resistor.
- For the second jumper wire, one terminal is connected to the 13th digital pin and the second terminal of the jumper wire to the negative terminal of the LED.
CODING/PROGRAMMING THE ARDUINO
WORKING PRINCIPLE
LED off
LED on
TRIPLE LED BLINK CIRCUIT
Hardware Required
- Breadboard
- Arduino board
- Jumper wires
- LED RED
- LED YELLOW
- LED GREEN
- 100ohm resistor
- Arduino code transfer cable
Connections
- Connect the LED to the breadboard.
- Connect one terminal of the 100 ohm resistor to the positive terminal of the LED and another anywhere on the breadboard.
- Similarly, other two LEDs, yellow and green are connected in the same pattern.
- Further, connect one terminal of the male to male jumper wire to GND and another terminal to the negative column of the power rail.
- Further, one terminal of a jumper wire is connected to the 8th digital pin of the Arduino board and another terminal is connected to the second terminal of the 100 ohm resistor.
- Taking another jumper , one end of it is connected to the 12th digital pin and the other end is connected to the second terminal of the second 100 ohm resistor and similarly the third jumper wire is connected to the 13th digital pin and its other end is connected to the second terminal of the 100 ohm resistor
- Three more jumper wires are connected. The first terminal of the first jumper wire is connected on the negative column if the power rail and another terminal is connected to the negative terminal of the LED. Other two jumper wires are also connected in the same nature.
CODING/PROGRAMMING THE ARDUINO
- In this circuit , we have 3 LEDs. We want those 3 LEDs to blink one after the other within a time interval of 1000 milliseconds, that is 1 second.
- To achieve this, the code is as following,
Comments
Post a Comment