Pages: [1]   Go Down
Author Topic: Getting the Teensy to recongize the LED's  (Read 397 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My circuit is currently:

TEENSY 2.0 to RESISTOR to LED to GROUND

Im trying to make it so that if green led = flash once, if yellow = flash twice, if red, flash 3 times

How would I do this? Is there a function call to make the Teensy board recognize the LED's? Or the Resistance?
Logged

SF Bay Area
Offline Offline
Edison Member
*
Karma: 11
Posts: 1244
Arduino Ninja
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You might be able to do this by attempting to read the LED voltage using an ADC, but that may not tell you anything because LEDs are made using various chemistries. The only reliable way to do this would be to use a color sensor chip and aim it at the LED. You'll find that to be a much more expensive and complicated project.
Logged

Unique RGB LED Modules and Arduino shields: http://www.macetech.com/store

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5666
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could read the voltage between the resistor and the LED.

That would tell you the difference between red and green, detecting other colors might be difficult.
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Offline Offline
Faraday Member
**
Karma: 30
Posts: 2501
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Each wavelength / band gap - has a certain forward voltage drop, so that's what you'd be measuring...  curious project I might have a play see what results i get...

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Let's say Im using these LED's

Code:
http://www.digikey.com/product-detail/en/WP113SRDT/754-1202-ND/1747601
http://www.digikey.com/product-detail/en/WP113GDT/754-1200-ND/1747599
http://www.digikey.com/product-detail/en/WP113YDT/754-1203-ND/1747602

How would I write that in Arduino?
Logged

Offline Offline
Faraday Member
**
Karma: 30
Posts: 2501
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

wow, i've not seen one of them since 1988 lol, age 7 at the top of the stairs my dad gave me a 9v battery and an LED, thinking back the 9v battery was pretty dead (he got me to taste it, very very mild) but yeah i connected the LED both ways until it lit up glowed almost changing color (obviously, too much voltage) but as the battery went dead , the LED was this type!

digitalWrite(pin,HIGH);

use a 300 ohm resistor in series to keep the current down on these old things...
Logged

Offline Offline
Faraday Member
**
Karma: 30
Posts: 2501
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

oh yeah, you meant reading the voltage duh....

hook one up and measure the voltage....
Logged

Pages: [1]   Go Up
Jump to: