Behind today’s door is the reason for the many 1-kohm resistors. Namely, what you find there is a so-called RGB LED RGB stands for red-greenblue, since this LED is actually three LEDs that can be connected through a common cathode. By varying the brightness of the individual LEDs using PWM, you can generate almost every colour conceivable.

You can see the layout of today’s circuit in the following figure. Note that the somewhat longer leg (the cathode) must be plugged into the GND contact strip.

Die RGB LED mit allen drei Vorwiderständen
The RGB LED with all three series resistors

In the Blynk app, a totally new element comes into play today, namely the ZeRGBa element (combination of Zebra and RGB). You can already see roughly how it works from the colourful design. You can either insert the element in your own new project and adjust the pins manually (red at D3, green at D5 and blue at D6) or load the interface of the test as usual via QR code. Whichever way you choose, don’t forget to enter the new token in the programme, which you can download as usual from below:

The sketch: A16_P10_Blynk6_RGB.ino
/*
Blynk 6: RGB
Change ssid, password and token
*/

char ssid[] = "YourSSID";
char password[] = "YourPassword";
char token[] = "7c5cc35bf1b54058b232f6392b847519";

#define BLYNK_DEBUG
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266_SoftSer.h>
#include <BlynkSimpleShieldEsp8266_SoftSer.h>

// Set ESP8266 Serial object
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(11, 12); // RX, TX

ESP8266 wifi(EspSerial);

void setup()
{
  // Set console baud rate
  Serial.begin(19200);
  EspSerial.begin(19200);

  Blynk.begin(token, wifi, ssid, password);
}

void loop()
{
  //the controll of the RGB-LED is done by Blynk automatically
  Blynk.run();
}

(The former Arduino Create embed is no longer available; the code is taken from the download of all sketches.)

blynk_tag1010-1

When you have uploaded the programme with your data and the interface has started in the app, you can move the circle in the ZeRGBa widget. You see that the colour of the circle changes. At the same time, the colour of the RGB LED on the board changes. So you can have fun playing around and trying out various colours. You can even get white if you move the circle to the top left corner. The three numbers above also give the current PWM value of the pins D3, D5 and D6. This time, too, you can conceivable use the programme for a living room lamp with mood lighting that can be controlled via app.

Das ZeRGBa-Element
Das ZeRGBa-Element