blynkkk / blynk-library

Blynk library for IoT boards. Works with Arduino, ESP32, ESP8266, Raspberry Pi, Particle, ARM Mbed, etc.
https://blynk.io
MIT License
3.81k stars 1.38k forks source link

Issue with terminal.print("text" + variable); #491

Closed macste7 closed 3 years ago

macste7 commented 4 years ago

111 Hi I have issue with print my variable with text on the same line. I will be very thankfully for resolve this problem or comment when I have bug in my code 👍

`#define BLYNK_PRINT Serial

include

include

char auth[] = "xxx";

char ssid[] = "xxx"; char pass[] = "xxx"; int i = 100; WidgetTerminal terminal(V1); BLYNK_WRITE(V1){ if(String("sample") == param.asStr()){ terminal.print("sample with int:" + i); terminal.flush();

} } void setup() { Blynk.begin(auth, ssid, pass); terminal.clear();

}

void loop(){ Blynk.run();

}`

vshymanskyy commented 3 years ago

It's invalid usage of strings. You should use:

terminal.print(String("sample with int:") + i);