Lucas Dachman

Lab 3

Objectives

  • Read Analog sensor values using analogRead()
  • Print sensor values to the serial monitor
  • Use analogWrite() on a PWM pin to dim an LED
  • Learn to fit an analog input reading into a single byte using the map() function
  • Use frequency modulation with the tone() command to to generate sounds

Materials

  • Arduino Uno
  • Patch wire
  • RGB LED
  • Linear Potentiometer
  • Twist Potentiometer
  • Photocell
  • Breadboard

Part 1: Potentiometers

Controlling the brightness of an LED with a linear potentiometer. The Arduino uses pulse width modulation (PWM) to set the brightness of an LED based on the input from the variable resister (the slider).

schematic

Part 2: Other Variable Resistors

Using two variable resistors to control the color of an RGB LED. The values of the photocell and the twist potentiometer are used to change the brightness of individual colors.

schematic