Introduction:

 

In this lab I will be learning about the use of buttons, PWM (pulse width modulation), and functions as the name of the lab suggests. There are two parts. The first part I will be watching a video and constructing the circuit as instructed on the video and writing the program to interact with it. This circuit will be using PWM to control the brightness of an LED. The second part I will be creating a program that will interact with the Arduino with the use of a button to control an LED.

 

Equipment/Components:

 

·         Arduino Uno

 

·         Small breadboard

 

·         Jumper wires

 

·         10kΩ resistor (x1)

 

·         220Ω resistors (x3)

 

·         USB cable

 

·         Pushbutton

 

·         5mm single-color LED

 

·         Digital Multimeter

 

 

 

Procedure: 

 

1.       Lab 2a: Procedure:

 

·         Watch the video: Tutorial 02 for Arduino: Buttons, PWM, and Functions (https://www.youtube.com/watch?feature=player_embedded&v=_LCCGFSMOr4)

 

·         Construct the breadboard circuit and implement the program presented in the video and in Chapter 2 (pp. 29-35) of your textbook to control the brightness of the external LED via PWM.

 

2.       Lab 2b:Procedure:

 

·         Design a circuit and Arduino program that accomplishes the following:.

 

·         Reads a press of a pushbutton once, and it cycles through all possible brightness values.

 

·         A press of the pushbutton a second time during the cycle, and it will “reset” the system by turning the LED off and setting the brightness value back to 0.

 

·         Another press of the pushbutton again, and it will then start the brightness cycle over again.

 

·         Include a video of your circuit in operation and any computer screenshots during its operation. Please include your Grantham ID number in the video to show your work..

 

·         Send your code file (.ino) of the lab completed and operational as well for credit.