Led Interfacing with Arduino
What is an LED?
The full form of LED is light-emitting diode. It is a small and Powerful light used in various applications.
Image And Symbol of LED:-
What is the current Sourcing?
When a device supplies current to a connected load, it is known as current sourcing. For example, when an LED and a resistor are connected between the microcontroller and ground, setting the pin logic (1) to turn on the LED and (0) to turn off the LED.
Circuit of Current Sourcing:-
What is the current Sinking?
Current sinking is when the power passes to the load and then to the object. Eg. When an LED and a resistor are connected between the power supply setting pin, logic that (0) turns on the LED and (1) turns off the LED.
Circuit of Current Sinking:-
1. pinMode( ):- Configures the specified pin to behave either as an Input or Output
Syntax:- pinMode(pin,mode);
Parameters:-
pin:- To which the object is connected on the Arduino Board.
2. digitalWrite( ):- It is used to turn on/off a component connected to Arduino. When set HIGH, it turns on, and when set to LOW, it turns off.
Syntax:- digitalWrite(pin,value);
Parameters:-
pin:- To which the object is connected on the Arduino Board.
3. delay( ):- It pauses the program for the amount of time in milliseconds.
Syntax:- delay(ms);
Parameters:-
ms:- To delay the program for milliseconds.
Task 1: Turn on the in-built LED of Arduino connected to pin no.13.
Task 3: Turn 5 LEDs in increasing order and turn them off in decreasing order.
0 Comments