Fading using PWM
Description
Microcontrollers have pins that can handle pulse width modulation, or a technique that emulates an analog signal by switching a digital signal from high to low at different speeds. In this lab, we run PWM to fade LED lights.
Materials
1 Teensy 2.0, 3-220 ohm resistors, 3 LEDs
Code
Code that fades LEDS with same fade patterns is here: LED Simulataneous Fade
Code that fades LEDS using different fading schemes was provided here: LED Pattern Fade
Code that establishes a serial i/o communication whereby a text command controls the brightness an LED: Serial LED Communication
Homework
Code that given a key press of a color code [r,g, b] will increase the brightness of the linked LED by 10%. Cycles back to 0. keyPressFade.txt
Latex diffuser ***
Materials: LED setup from this lab, 2 paper cups, 1 latex glove.
Instructions: Cut out the bottoms of the two cups. Cut a section of latex material that can fit the diameter of the cup with some margin. Hold taut the latex over one cup, then lock the latex into place by placing the remaining cup over it.
Observations: Latex is a great diffuser, has a nice tangible and deformable properties, and can easily be scaled to fit onto any rigid body.
** See attached picture
- Login to post comments