Change Step property of Step H button from Menu selection

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?

I don’t think that’s currently available.

You would have to use a slider or several differently scaled sliders to change a variable in the way that you want.

I just tested it, and while Blynk.setProperty(vPin, "step", value); will compile, it has no effect. min & max do, just not step.

@Dmitriy just an oversight, or too complicated to initialize?

Created ticket - https://github.com/blynkkk/blynk-server/issues/927

2 Likes

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?

The latest one is 0.33.0.

@irishbeard Android/iOS? and what version of the app are you using?

Sorry you’re right, its version 0.33.0. I copied that the start server output so I saw “Blynk Server 0.33.1-SNAPSHOT successfully started”

I’m using the iOS app and the app version is 2.18.0(1)

Not yet implemented on iOS. Only on Android.