From the course: Learning Arduino: Interfacing with Analog Devices
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Wire up an LED - Arduino Tutorial
From the course: Learning Arduino: Interfacing with Analog Devices
Wire up an LED
- [Narrator] All right, so in this example, we are going to generate pulse width modulation from Arduino to brighten an LED and to dim it. So I'm going to go ahead and start wiring. So it's a very simple circuit, here is a resistor, that's a 33 ohms resistor. And then I'm going to connect the LED to one side of the resistor. So the long side of the LED is going to the side of the resistor. Now the other side of the LED is going to be connected to ground from the Arduino. And the other side of the resistor is going to be connected to pin number nine from the Arduino. And the reason why we selected pin number nine, because it has the tilde sign beside it to generate a pulse with modulation, okay? And the last thing is just connecting the Arduino to the computer.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
How Arduino generates analog output1m 4s
-
(Locked)
Understanding pulse-width modulation (PWM)2m 8s
-
(Locked)
Understanding the analogWrite function with PWM1m 19s
-
(Locked)
Wire up an LED1m 5s
-
(Locked)
Write code to use PWM with the LED1m 56s
-
(Locked)
Understanding the map() function1m 45s
-
(Locked)
Wiring a potentiometer to control LED1m 14s
-
(Locked)
Coding to control the LED with a potentiometer3m 42s
-
(Locked)
-
-
-