Zergba code (or Use Sliders to control RGB led)

Hi guys,
I would like to know the code used to make Zergba .
And if it’s possible to change the animal used.

No. The picture is probably just part of the graphic design anyhow, not the code. But the App is NOT open source, so we can’t see or change it.

But you can easily duplicate the output data with three sliders and not use the zeRGBa if you really have an aversion to zebras :smiley:

My problem is I want to have a mode that will automatically change the color of the rgb without me doing it manually and that over and over again. Like a sort of fading

Google for one of the many codes that do exactly such. Then adapt for Blynk GUI control as required.

I already have the code that can do it . I just don’t know how to make blynk do it using a button

A Blynk button just supplies a value. Use some form of if x == y do z code to control your fade routine and use a Blynk button to supply the x

Remember to avoid blocking loops for that purpose (for, while, do…)

I also thought about using the blynk slider as a potentiometer (connecting the node MCU to an Arduino uno) but it just doesn’t give me the good values.
What i want is to use the blynk sliders and control the color manually and also be able push a button on the blynk app and have the automatic change happen.

The thing is I want to use sliders in order to have more than 3 colors (red,green,blue) also want to control the brightness.

The very nature of the intensity values to the R, G, & B portions dictate the brightness… so one way of using a standalone slider it is add or subtract a “brightness” value to all the other three sliders values at the same time.

As for an automated option… once you have the code to control the RGB LED, you can use random number generation to emulate the sliders and use the brightness to set limits of the random numbers.

Basically, everything you want to do requires coded routines… none of which is Blynk specific. Blynk just allows another way of supplying a user interface to those coded routines.

So there is no way I can use the sliders information(I would consider each on of them as potentiometers) to control an arduino uno.
For example link the D1 D2 and D3 outputs (that are respectively connected to the blynk sliders) to A0 ,A1 and A2 (analog inputs) of the arduino.

The arduino uno would just help me take the value of D1 , D2 and D3 and apply them to pin 11,10 and 9

I don’t know if you understand me but I am saying that I would like take the information of the sliders to use them through an arduino uno

Umm, not quite the correct way of doing a cross device communication :wink: For one thing, the ESP only outputs 3.3v so its PWM output wouldn’t properly register as the full range of the Arduino’s ADC inputs.

Why run seperate devices anyhow? You should be able to merge the Arduino RGB code into the ESP and instead of looking for the ADC for input, look to the value supplied by the slider code.

                            Please help 

So here is my problem. I wrote a code on my arduino UNO that can change the color of my RGB led automatically. (Red, pink, yellow ,blue, magenta,green etc) it’s just like fading, it does this over and over

. now I want to be able to chose one color thanks to blynk sliders. But I don’t want to connect my node MCU directly to the RGB led. I want to connect it to my arduino uno and then use the Sliders values to control the color of my RGB led.

The thing is I connected the blynk sliders pins(respectively D1,D2 and D3) to A0 , A1 and A2 of my arduino uno in order to control the red pin(11), greenpin(10) and blue pin(9 ) : pmw pins

then I wrote in my code
{AnalogWrite(11, analogRead(A0));
My purpose is to use the blynk sliders as virtual potentiometers but it just doesn’t give me the right values. Right from the start without moving the sliders I get a blue light ) therefore I can never get the colors I want when moving the sliders.

NOPE! Not the correct forum procedure :stuck_out_tongue: You already have this topic created… Please do not create other topics for same/similar/related issue.

I merged both.

Read my response above for the reason you are not getting the results you are looking for.

If you really want to keep seperate devices, then you can try another library like this to share data between them.

OK thanks will look at this

So here it is I want to do it in a other way and write the color change code directly in the esp. But I don’t really know how to write Blynk codes .
Can I do something like if I push a button on the app D5( for example ) then blynk will run my code ?? I’m not sure how to write this since blynk seems to use a slightly different vocabulary

Blynk is basically a library (well, much more, but for simple explanation this works :stuck_out_tongue_winking_eye: )… and like all libraries it has its own formats, commands, layouts, etc. There is no magic answer on how to run existing code with Blynk (or another GUI App).

There is the Documents, Help Center and Sketch Builder (links at the top of this page) available to learn how Blynk works.

Once you understand that, it should be easier for you to merge your RGB code with Blynk’s slider/button control options.