I'm looking for the way how I can turn off an analogwrite function when I'm using RGB LED in Arduino.
I got I can turn on the LED and make it glow red by:
analogWrite(RED, 255);
(RED meaning the number of the red pin)
But I have no idea how to turn the LED off.
I'm assuming that:
letting
analogWrite(RED, 0);
analogWrite(GREEN, 0);
analogWrite(BLUE, 0);
will result in LED glowing black, not being turned off.
Am I wrong with this?
By the way, is it possible to let LOW or HIGH like digitalWrite function?
Somebody help me please!
sapiens2525:
analogWrite(RED, 0);
Should make the LED on pin RED to off.
Please post a schematic. This is theoretical until we know more about what is in front of you.
LOW happens to work like zero. HIGH should work like 1, a very very dim illumination if you use it as a constant in analogWrite ().
So no, and why do you even wanna do that?
a7
Thanks for your help.
Well, that's not clear for me.
If analogWrite(RED, 0); means turning off the red light,
wouldn't there be any way to make the LED glow black?
This assumption comes from that RGB(0,0,0) equals BLACK.
And sorry for no schema, since I'm looking for LED that would actually act with my ino code.
I didn't say there was no way to make black.
You have the right idea, if the schematic you are forcing me to imagine is what you are dealing with.
Write zero to all three LEDs and it will glow black.
Post a schematic. See you then.
sapiens2525:
with my ino code.
Post your code then.
a7
Turn the light off in your work room… is the lamp glowing black ?
2 Likes
LOL, that's right, LEDs don't glow black, they can at best be totally off.
a7
Then on the other hand, how can I make the LED glow black?
sapiens2525:
the LED glow black?
Srsly? Unless you mean produce light in the ultraviolet region of the spectrum, I assume you are trolling.
Black is, in this context, no light. Off.
a7
Got it, I had no knowledge in Electronics.
Thank you.
J-M-L
November 9, 2023, 2:38pm
10
Technically, LED emit light, and black is the absence of light. So, a LED can't really "glow" black in the way it emits light
For sure. It is a black light luminaire.
b707
November 9, 2023, 2:54pm
12
It is not a "knowledge in Electronics", it is just a common sense...
Are you sure? What is "black light" ? not a UV or IR , but exactly black?
1 Like
system
Closed
May 7, 2024, 2:58pm
14
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.