I’d like to be able to control the step size of a “Step H” or “Step V” button using the output of a “Menu” item.
Is it possible to programmatically change the Step property within Step H/V buttons? I’ve read the section on change widget properties but it says that just color, label, min and max are supported. Any ideas on how to achieve this?
// Example setting step interval from menu
BLYNK_WRITE(V1) {
switch (param.asInt()){
case 1: // step interval = 1
step=1;
break;
case 2: // step interval = 5
step=5;
break;
case 3: // step interval = 10
step=10;
break;
case 4: // step interval = 50
step=50;
break;
case 5: // step interval = 100
step=100;
break;
default: // Set default step to 10
step=10;
}
}
How do I update the Step H button “Step” property with the V1 pin?
What is the code for changing Step parameter in Step H/V buttons?
Hi Dmitriy, I tried setting up a local blynk server with the latest release (version 0.33.1) and tried testing it with this code:
BLYNK_WRITE(V24) { // V24 is the menu item
switch (param.asInt()){
case 1:
Serial.println("Item 1 selected");
Blynk.setProperty(V1, "step", 1); // V1 is the Step H button
break;
case 2:
Serial.println("Item 2 selected");
Blynk.setProperty(V1, "step", 5);
break;
case 3:
Serial.println("Item 3 selected");
Blynk.setProperty(V1, "step", 10);
break;
case 4:
Serial.println("Item 4 selected");
Blynk.setProperty(V1, "step", 20);
break;
case 5:
Serial.println("Item 5 selected");
Blynk.setProperty(V1, "step", 50);
break;
case 6:
Serial.println("Item 6 selected");
Blynk.setProperty(V1, "step", 100);
break;
default:
Serial.println("Default step = 10");
Blynk.setProperty(V1, "step", 10);
}
}
The serial prints are working correctly (prints which case gets selected) but I’m not getting the step property to update correctly. The step size is still using the property from the app.
Also, do the new server releases also get pushed to the cloud based server?