When I declare a WidgetTerminal object in my project, it causes sprintf to return zeros for floating point and doubles. I am running the project on an Arducam CC3200 Uno using the RedBearLab WiFi Mini configuration in Energia. The following code sample illustrates the issue"
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "{ProjectAuthToken}";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "{SSID}";
char pass[] = "{PASSWORD}";
WidgetTerminal terminal(V1);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
test();
}
void loop() {
Blynk.run();
}
void test() {
char buffer[10];
sprintf(buffer, "%f", 123.45);
Serial.println(buffer);
}
The output from sprintf is “0.000000” if WidgetTerminal is declared. If I comment out “WidgetTerminal terminal(V1);” then the correct serial output is displayed as “123.45”.
Here is a screenshot to illustrate: