How can I display the values ​​of zeRGBa on the Terminal?

Hello,
i want to Display the Value of my zeRGBa on my Terminal. The zeRGBa is on SPLIT mode. I wrote this code but it obviously doesn’t work. Can you guys help me to correct my code? You can see my code below.

Thanks!


#include <ESP8266WiFi.h>
#include <SPI.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "0";
char ssid[] = "0";
char pass[] = "0";

int r;
int g;
int b;

WidgetTerminal terminal(V1);

BLYNK_WRITE(D0) {
  r = param.asInt();
}
BLYNK_WRITE(D1) {
  g = param.asInt();
}
BLYNK_WRITE(D3) {
  b = param.asInt();
}

void setup() {
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
}

void loop() {
  Blynk.run();
  
  terminal.flush();
  terminal.print(String(r));
}

Sooo many issues :stuck_out_tongue_winking_eye: We aren’t code mechanics here…

You use virtual pins in Blynk functions, not digital pins… and certainly not the silkscreened pin labels.

http://help.blynk.cc/getting-started-library-auth-token-code-examples/blynk-basics/what-is-virtual-pins

Remove these from the void loop(); and put them in a timed function of it’s own if you need…

Besides, you don’t have any code to take the individual values and combine them into a string to display anyhow… That stuff is programming 101, not Blynk specific.

But you could simply send the colour channels value directly to the terminal in each properly assigned BLYNK_WRITE(vPin) function.

The terminal wiget can also work with a Blynk.virtualWrite(vPin, value) command.

BLYNK_WRITE(vPin) {  // Use virtual pin assigned to RED channel on the zeRGBa
  r = param.asInt();  // Get value from zeRGBa widget
  Blynk.virtualWrite(V1, r)  // Print value to Terminal
}