Introduction: Using PWM to Control Lights
In this project I am going to tell how you can use PWM to control LED's.
For this project you need,
1. Arduino UNO (you can use any simillar boards you like)
3. Some jumper wires
Step 1: Circuit Description.
First we need to connect the LED's cathode pin to the gnd pin of arduino. Then we will connect the anode to the pin 5 of arduino. Now we are all done with the circuits.
Step 2: Coding.
Now just connect your arduino to your computer and just paste this code in your arduino ide and hit the upload button.
The code is here:
int a = 6;
for(int p = 0; p <= 255; p = p+2)
for(int p = 255; p >= 0; p = p-2)