Led Fade Demo

LED fade demo for my final

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Connections

1. First connect the 5V and GND to the power and ground rails on the breadboard.

2. Connect the left potentiometer pin to the hot and the right most to the ground.

3. The middle/top pin should go to an analog pin, I chose to use A0.

4. Connect the led's ground wires to the ground rail

5. Connect the hot line from the LED to a 220 ohm resistor and then connect those to pins 12-8 so the fading is right.

Apply the code and bam. (Code in step 2)

Step 2: Code

The code is decently simple and could very likely be improved. I used hard coded values so once it reach's a certain PWM level if would change the lights as needed. I used a "vals" array to simply hold my values for updating, this really just made it a little easier to visualize for me.

Be the First to Share

    Recommendations

    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    Discussions