The product description says:
" The LED can be easily turned on or off by any logic level output."
(connect to which contact(s) on the board?)
The adafruit learning system tutorial states:
>Interrupts and LED control:
>vo id Adafruit_TCS34725: : setInterrupt(bo o lean i)
>Sets the sensor interrupt to generate an interrupt when the detected level is within the limits
>(see setIntLimits() below).
>Passing "false" will enable the on-board led for reflected light measurement.
>Passing "true" will turn the led off for incident light measurement.
(sounds simple...)
I am running the example "colorview" with the line:
"tcs.setInterrupt(true); // turn off LED"
but the LED stays on all the time.
What am I missing? What do I do wrong?
Could you supply a schematic of the board?
Thanks,
hgeagle
TCS37425 RGB color sensor board
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88144
- Joined: Sat Feb 07, 2009 10:11 am
Re: TCS37425 RGB color sensor board
Are you using the breakout board or the Flora version of the sensor? With the breakout board you can control the LED with the LED pin. I'm looking into the library issue & schematics.
- hgeagle
- Posts: 7
- Joined: Tue May 21, 2013 3:10 pm
Re: TCS37425 RGB color sensor board
Currently I am using the breakout board. Thanks for looking into this!
- adafruit_support_bill
- Posts: 88144
- Joined: Sat Feb 07, 2009 10:11 am
Re: TCS37425 RGB color sensor board
Here's the word from the design team:
and example code:tie LED low to turn it off (or to a digital pin to control it on/off)
to control the LED from the INT pin, tie LED to INT. then you can call setInterrupt to turn it on/off. just give it at least 50ms to stabilize before you take a reading!
Code: Select all
tcs.setInterrupt(false); // turn on LED
delay(60); // takes 50ms to read
tcs.getRawData(&r, &g, &b, &c);
tcs.setInterrupt(true); // turn off LED delay(1000);
- hgeagle
- Posts: 7
- Joined: Tue May 21, 2013 3:10 pm
Re: TCS37425 RGB color sensor board
Thanks, that did it!
It might be useful to include the wiring (LED - INT) in the color sensor tutorial(s). I did not see it there...
I am wondering how this issue is dealt with in case of the Flora color sensor version (there is no LED or INT pin).
The "Chamaleon Scarf" is really cool!!
It might be useful to include the wiring (LED - INT) in the color sensor tutorial(s). I did not see it there...
I am wondering how this issue is dealt with in case of the Flora color sensor version (there is no LED or INT pin).
The "Chamaleon Scarf" is really cool!!
- adafruit_support_bill
- Posts: 88144
- Joined: Sat Feb 07, 2009 10:11 am
Re: TCS37425 RGB color sensor board
Thanks for the feedback. I'll be updating the tutorial shortly.
- michaelaf
- Posts: 3
- Joined: Sun Apr 28, 2013 6:33 am
Re: TCS37425 RGB color sensor board
Hello,
I am doing the same thing today, also wanting to turn the led off. Does "tie LED to INT" mean connect the two pins on the TCS sensor board with a wire on the breadboard? I imagine this is what you mean but I'd rather be sure...
Thanks
I am doing the same thing today, also wanting to turn the led off. Does "tie LED to INT" mean connect the two pins on the TCS sensor board with a wire on the breadboard? I imagine this is what you mean but I'd rather be sure...
Thanks
- hgeagle
- Posts: 7
- Joined: Tue May 21, 2013 3:10 pm
Re: TCS37425 RGB color sensor board
Hello michaelaf,
Yes, use a wire and connect LED with INT on the breadboard. But then you need to use the code
"tcs.setInterrupt(true); // turn off LED"
to turn the led off.
I think you can just connect the LED pin with "ground" (".. tie LED low...") to turn it off without code. It works, I tried it, but without seeing the schematic I cannot be sure if that could lead to other problems.
Maybe Bill could advise...
Yes, use a wire and connect LED with INT on the breadboard. But then you need to use the code
"tcs.setInterrupt(true); // turn off LED"
to turn the led off.
I think you can just connect the LED pin with "ground" (".. tie LED low...") to turn it off without code. It works, I tried it, but without seeing the schematic I cannot be sure if that could lead to other problems.
Maybe Bill could advise...
- michaelaf
- Posts: 3
- Joined: Sun Apr 28, 2013 6:33 am
Re: TCS37425 RGB color sensor board
Hello hgeagle,
I've done it via the breadboard and it worked perfectly. Thanks
I've done it via the breadboard and it worked perfectly. Thanks
- adafruit_support_bill
- Posts: 88144
- Joined: Sat Feb 07, 2009 10:11 am
Re: TCS37425 RGB color sensor board
Yes, you can tie it to ground or pull it low with a spare pin if you have one.
- michaelaf
- Posts: 3
- Joined: Sun Apr 28, 2013 6:33 am
Re: TCS37425 RGB color sensor board
Hi Again,
Is there a way to turn the LED off all the time? At the moment, using "tcs.setInterrupt(true); the LED flashes briefly each time the loop runs, but I'd like it to be off all the time. How can I write this into setup instead of the loop?
Is there a way to turn the LED off all the time? At the moment, using "tcs.setInterrupt(true); the LED flashes briefly each time the loop runs, but I'd like it to be off all the time. How can I write this into setup instead of the loop?
- adafruit_support_bill
- Posts: 88144
- Joined: Sat Feb 07, 2009 10:11 am
Re: TCS37425 RGB color sensor board
Call setInterrupt(true) in setup (and never again). Or just wire the LED pin to GND.Is there a way to turn the LED off all the time?
-
- Posts: 1
- Joined: Wed Mar 05, 2014 7:03 am
Re: TCS37425 RGB color sensor board
Hi
Is there a way of turning the LED off/on if using the Flora color sensor version (there is no LED or INT pin)?
I've tried the tcs.setInterrupt(true/false); method but without success.
If this is not successful my plan B will be to connect VIN to a digital pin and briefly power up the sensor when I want to use it.
Thanks
Is there a way of turning the LED off/on if using the Flora color sensor version (there is no LED or INT pin)?
I've tried the tcs.setInterrupt(true/false); method but without success.
If this is not successful my plan B will be to connect VIN to a digital pin and briefly power up the sensor when I want to use it.
Thanks
- adafruit_support_bill
- Posts: 88144
- Joined: Sat Feb 07, 2009 10:11 am
Re: TCS37425 RGB color sensor board
The Flora version does not have LED control. I think your Plan B is the way to go.
-
- Posts: 1
- Joined: Sun Jun 22, 2014 11:10 pm
Re: TCS37425 RGB color sensor board
Hello! I major Design Engineering in university in Korea and I studying TCS37425 RGB color sensor with a RGB Neopixel.
l tried "Chameleon Scarf" arduino source, and I need some more source.
This source is now possible to only once, but color recognition is, I is repeated once, but want to be able to detect the sensor.
Therefore, after the last of the sauce in the "void loop" I hope to inform.
l tried "Chameleon Scarf" arduino source, and I need some more source.
This source is now possible to only once, but color recognition is, I is repeated once, but want to be able to detect the sensor.
Therefore, after the last of the sauce in the "void loop" I hope to inform.
Please be positive and constructive with your questions and comments.