Recent Changes - Search:

Reference Links

Topics

Programming

Prior Class Pages

PM Wiki

edit SideBar

Sp15-Class2

Rules of Thumb for LED forward voltages (vF) (how much voltage the LED needs to go on):
White and Blue ~3.3V
Green, Yellow 2V-3V
Red 1.8V

You can briefly turn on LEDs that have a 3vF directly from an Arduino's digital pins (5v) without damaging them. Remember, you can always test with a variable power supply. Use your multimeter in parallel with the LED. Start with the voltage turned all the way down and slowly turn the voltage up. **Don't do this if you need all of your LEDs, you might burn out one or two! When the LED is first on brightly, its close to its Vf. If the LED changes color or gets dimmer as voltage goes up, turn it down quickly! You've given it too much :)

How do I know which resistor to use?
Well, you could use Ohm's Law , or you could use this handy site: http://led.linear1.org/1led.wiz

Graphical Resistor Calculator
http://www.dannyg.com/examples/res2/resistor.htm


 


 


 


 

For code to use with your Arduino Circuit, first try this one to see if your button is working. *Note that to get the serial window to show up and print out your button values, you will need to click on the little magnifying glass on the upper right of the Arduino software window.



 

Here is the code that I wrote in class:
https://drive.google.com/open?id=0B1qpUXvovN0Eflo4ZERESjVyNWFrQkRyUHg1T2ZsQkpFczJiUXdEcTBjd1N3NEhHRUE4UkU&authuser=0

Here is the example code that lets you toggle the LED on and off with your button. It uses millis( ); to do timing so that it doesn't toggle overly fast. See my second code example named "buttonToggleTooFast" for code that toggles too fast.



 

Now its time for some fun.... Lets make our own switches! Switch Lab


 


 

Edit - History - Print - Recent Changes - Search
Page last modified on February 17, 2015, at 10:58 AM