Hello,
Im practising to make the rgb leds working here : Wokwi - Online ESP32, STM32, Arduino Simulator
but on some way I do not see any color ?
Can someone help me figure out what I have done wrong ?
Hello,
Im practising to make the rgb leds working here : Wokwi - Online ESP32, STM32, Arduino Simulator
but on some way I do not see any color ?
Can someone help me figure out what I have done wrong ?
You only ever set red on, green off, blue off.
But then, you don't tell us what it's doing, vs what you expected, so ???
correct, so I expect that the led will turn red but I do not see any color
Hi,
Your LED is common ANODE not CATHODE.
LED common needs to go to 5V not gnd.
Then you need to modify your code to suit.
Tom....
I discovered that also
But I find that the led is "burning" very bright.
Schould I use bigger resistors then 220 Ohm that I use now.
Higher values are perfectly fine.
Different values can be used for different colors to make each appear evenly bright...
Not all colors have same efficiency and also the sensitivity of our eyes is not equal for each color.
Just try and play.
For real: stay above 220. In tinkercad: probably difficult to release the magic smoke that is present in each electric component as a standard feature off factory...
I don't believe it makes any difference in the simulator. IRL is another story.
oke
Maybe 330 ohm ??
Come on. Be brave! Try!
I tried in wokwiki and see no difference.
Still the led "burns" very bright
Try 10 kohm.
If that is still bright, then the simulator is not simulating accurately with respect to led current.
Remember: the human perception of light intensity is far from linear. In real life the difference between 220 and 330 will not be really clear. Unless you see them next to eachother... Our eyes have a special trick to see very small differences when next to eachother...
Because of the reason explained in post #9.
Time to try a real circuit!
Even same-color, same size LEDs can have dissimilar brightness in the same circuit. Some are made to be bright, some are made to glow at low brightness.
One question are hunting me
A person said someone had build a board with 2 switches.
When switch1 is on . A red light is on
When switch2 is on . A green light is on.
Can this be done with arduino ?
Yes.
Maybe with something like this :
if (switchValue1== 1) {
//set the red light on
// set the green light off
else (if switchValue2 == 1 {
// set the red light off
// set the green light on
}
or
if (switchValue == 1 && switchValue2 ==1 ) {
// set the green light on
// set the red light off
} else (if switchValue1 == 1 && switchValue2 == 0) {
// set the green light off
// set the red light on
}
?
If you have two switches and two LEDs you could have four results. 00 01 10 11
Have you tried the other suggestions in this topic?
yes, I tried and they work
This is a new "problem"
but I have 2 switches and 1 led.