Wiring Your LED for PWM with Arduino | Task 2
Wiring Your LED for PWM
To make your LED fade using
PWM
, we need to connect it to a special pin on the Arduino Uno. These are called PWM pins and have a tilde (~) next to their number, like ~3, ~5, ~6, ~9, ~10, and ~11.
You’ll Need:
- 1 x LED
- 1 x 220Ω resistor
- 2 x jumper wires
- 1 x Breadboard
- 1 x Arduino Uno
- 1 x USB cable
Steps to Build the Circuit
- Insert the LED into the breadboard. The longer leg is the positive side (anode).
- Connect the 220Ω resistor to the same row as the long leg of the LED.
- Connect the other end of the resistor to any PWM pin on the Arduino.
- Connect the short leg of the LED to a GND pin using a jumper wire.
- Connect the Arduino to your computer using a USB cable.