BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Multi-colored LEDs

#1

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

#2

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

0 Likes

#3

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.

0 Likes

#4

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.

0 Likes

#5

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

#6

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

0 Likes

#7

@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?

0 Likes

#8

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.

0 Likes

#9

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

0 Likes

#10

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

0 Likes

#11

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)

0 Likes

#12

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

#13

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

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

1 Like