Multi-colored LEDs

I would value the addition of mutli-colored LEDs where the value from a pin changs the color of the LED (e.g. 1= green, 0=red). And, taking this a step further, could the LEDs have different states (on, off, blinking slow, flashing fast) based on pin values?

In general, such features would enable a single LED widget to convey more information, thus freeing valuable screen space for other widgets.

2 Likes

as you descried you have to write your own library to convert the reading from the monitored pin and
use that value to define the particular color you need and send the RGB code array to the PWM pins that will change the RGB LED color

scropion86, I’m puzzled. I am talking about the LED widget in the iOS Blynk app, not a real LED connected to my Arduino.

In the iOS app I can select a color and define which pin will control it to switch on or off. My suggestion is to enable pin values to be able to affect the color and state of the LED widget in the Blynk app.

OK. i misunderstand . but its a good idea as per the value from arduino pin , the widget LED color will get changes
we can ask @Dmitriy to look at it.

Well, @db533 you could do that via code in your sketch… In case you want a widget with such features… it may be not so easy, cause will have many settings in order to enable that. But anyway thanks for ideas.

1 Like

How about you just have the LED widget optionally listen to three pins for r, g, b values…?

@Dmitriy, how would you use code to control cuurrent LED widget in iOS app tO change color? The color is selected in the widget. The app only lets a pin value switch the LED on/off, no? Or is there some other approach Icould use in my code to change the color of an LED widget?

The app only lets a pin value switch the LED on/off, no

Also you could change brightness when sending int values between 0-255 to LED Pin. But correct, no way to change color right now.

Also I miss option to change color of LED widget, not only from LED widget settings, but from my code.

Hi this is a great idea and would be really helpful.

It could be a virtual RGB LED which reads from three analog pins or virtual pins to control color and brightness like a real RGB LED driven off 3 PWM pins.

adafruit-arduino-lesson-3-rgb-leds/theory-pwm

Rob

I would like to support the suggestion to be able to change the led color depending on input.

Specifically, I am displaying the battery status of a remote sensor in my project.
Now I am using 2 leds, one green for battery ok, one red for battery low.
It would be much more elegant to have one led to be either red or green.
I am sure there are many instances where such a 2-state indicator led would be very usefull.

My 2c.

Thomas
(love Blynk btw)

http://docs.blynk.cc/#blynk-main-operations-change-widget-properties

Change Widget properties
Changing some of the widget properties from hardware side is also supported.
For example, you can change the color of LED widget based on a condition:

//change LED color
Blynk.setProperty(V0, "color", "#D3435C");

//change LED label
Blynk.setProperty(V0, "label", "My New Widget Label");

Pete.

1 Like

Thank you! Read a lot of the docs but missed this. Will try it.

Edit: Perfect - works. (What else??)

1 Like