Laboratory Experiment 3
Laboratory Experiment 3
Laboratory Experiment 3
COE 5
INPUTS
Push Buttons
Potentiometers
symbol (NO)
Exercise 1: Button-Led Circuit 1
The purpose of the Button-Led Circuit 1 is to demo how Arduino
will be controlling an LED via pushbutton.
Exercise 1: Button-Led Circuit 1
Write the sketch below and verify the result.
For electricity to flow, a complete circuit from the power to ground shall be
established by the push button.
Exercise 2: Button-Led Circuit 2
The purpose of the Button-Led Circuit 2 is to demo how Arduino
can change the brightness of an LED via two pushbuttons.
Exercise 2: Button-Led Circuit 2
Two ways to change the brightness of an LED
“The more time that the LED is on in a given period of time, the
“brighter” it will appear
Exercise 2: Button-Led Circuit 2
PWM – Pulse Width Modulator
2. Upload the sketch of exercise 2 verify the result. What happens if both
pushbuttons are pressed? Why?
Arduino Cookbook
Recipes to Begin, Expand, and Enhance Your Projects
By Michael Margolis
Introduction to Arduino
by Alan G. Smith