Sensing Part 1: Potentiometers
This lab expands the 3-LED circuit created in the previous lab and attaches two potentiometers to provide analog control of LED output. The first of these potentiometers (A0) controls the brigthness of the LEDs; the other (A1) controls the rate at which the LEDs blink.
Code has been modified from the original to create a more complex sequence of blinks incorporating all three LEDs.
I used three potentiometers in the circuit. The first potentiometer controls the brightness of all LEDs. The second one controls how frequently the selected LED blinks. The third potentiometer is used to select which LED blinks. The input of the 3rd potentiometer was read and divided into intervals of 100. For each increment of 100, it makes the next LED blinks. The sequence is red, green, blue. For example when the potentiometer reads between 0-100, the red LED blinks. When the potentiometer reads between 100-200, the green one blinks. For the next 100 increment, the blue one blinks.
I like blinky lights but to be able to control the blink rate of all 3 LEDs independently with the potentiometers the use of the delay function shown in the example sketches results in unsatisfactory results when more than one LED is needed to be controlled or other operations need to take place such as reading an analogSensor.
Description
In this assignment I use two analog potentiometers to control my LEDs (R/G/B). One of the potentiometers controls the blinking speed of the LEDs, while the other regulate the fading. The connected potentiometers controls the all three LEDs at the same time.
Components
2 x Potentiometers
The page would not allow me to upload video. I do have a clip of the potentiometers controlling the LEDs.
CODE:
Description
This program turns on and off a LED. The amount of time the LED will be on and off and the brightness depends on the input of a two potentiometers.
Description:
This LED diffuser uses two analog potentiometers to control brightness and blink rate. The code is adapted from the sample code for three pots, but modified to receive input from only two (my third potentiometer was acting strangely, causing short circuits and emitting a slightly burnt smell, so I decided it was best to avoid using it). Blinking has a floor to prevent crazy, seizure-inducing blink rates, and also instead of turning off fully, brightness is brought down to half the initial value.
Components: