It has been awhile since I messed with Blynk images so I just slapped this test together… and the setproperty()
commands work as implied.
Note, I typically use PNG images, and obviously only one image at a time per Image Widget.
Also, the Animated GIF screen capture is messing with the otherwise smooth image motions.
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
BlynkTimer timer;
char auth[] = "**********"; // Local Server
char ssid[] = "**********";
char pass[] = "**********";
char server[] = "10.10.3.13"; // IP for Local Blynk Server
int port = 8080; // Port for Local Blynk Server
int rot = 1;
int skl = 100;
int ArrowAngle;
void setup() {
WiFi.begin(ssid, pass);
Blynk.config(auth, server, port);
Blynk.connect();
/*
In App's Image Gallery Widget, there must either already be a valid image URL already loaded,
or at least had the ADD IMAGE URL "button" pressed once (even if no URL added) before
exiting the Widget's edit mode, or else NO image will be loaded.
*/
Blynk.setProperty(V1, "urls", "http://10.10.3.13:8000/Yellow_Fan.png");
Blynk.setProperty(V3, "urls", "http://10.10.3.13:8000/Arrow.png");
// Timed Lambda Function - UpTime counter
timer.setInterval(1000L, []() { // Run every second
Blynk.virtualWrite(V0, millis() / 1000); // Display the UpTime in Seconds
}); // END Timer Function
// Timed Lambda Function - Fan Rotation and size
timer.setInterval(100L, []() {
Blynk.setProperty(V1, "rotation", rot); //0-360 degrees
rot = rot + 30;
if (rot > 360) {
rot = 0;
}
Blynk.setProperty(V1, "scale", skl); //0-100 percent
skl = skl - 10;
if (skl < 10) {
skl = 100;
}
}); // END Timer Function
}
void loop() {
Blynk.run();
timer.run();
}
BLYNK_WRITE(V2) { // Rotate the arrow image
if (param.asInt() == 1) {
for (ArrowAngle = 0; ArrowAngle <= 90; ArrowAngle += 15) {
Blynk.setProperty(V3, "rotation", ArrowAngle); // 90 degrees
}
} else {
for (ArrowAngle = 90; ArrowAngle >= 0; ArrowAngle -= 15) {
Blynk.setProperty(V3, "rotation", ArrowAngle); // 0 degrees
}
}
}