I want to use Blynk to control a number of things, one of them being the volume of TV etc. This is done via IR so the notion of having a range which the step widget moves between doesn’t really work as the TV remote just does volume up and volume down there is so “set volume to level 15”. If using a combination of Blynk and the actual TV remote means that the volume level could come out of sync.
What would be nice is to have a step widget that can send an arbitrary value for up and for down, a bit like using buttons but it would look nicer as a step widget.
If the step widget does already do that that then that would be great, but I can’t see how. It seems to send the current value in the range between your set min - max as it cycles up and down.
The TV can’t feed back it’s current value, that is why I just want to send either a volume up/down command rather than a value in the range. I think I mislead you by saying I wanted to send an arbitrary value, what I meant by this was to send an “up” or “down” command rather than a specific volume level. So effectively like using two button widgets, just nicely contained in one widget.
I see. So just assign the Step widget to a virtual pin, then, in code, just simply acknowledge each increasing or decreasing value as an up or down counter, then send out your own up/down signal accordingly.
That’s what I have so far, but have an issue when you reach 0 on the step widget and want to go lower. I know you can have it wrap round the values, but then it’s more code on my controller to account for wrapping to detect increase/decrease.
My other idea was to set a wide range on the step widget and set it to the middle value so unlikely to hit the extremes. But thought it worth suggesting an improvement to the widget as it would be a cleaner solution.
OK, I get it now… yes, I second that idea! Adding another toggle option that switches between what it is now and sending out a simple, repeating, HIGH/1 or LOW/0 depending on up/down left/right press. Could have many uses.
Or they could just make another toggle switch type widget… never too many widget options I say
Wouldn’t that get confusing? increments and decrements in ranges of 0.1 to whatever your MAX is… but goes negative if set at 1 and decremental pushes are received… or am I getting your idea all wrong?
Perhaps if set to 0 then toggles positive/negative or just high/low results
I agree that will work, but set it for when 0 steps are chosen… that way people can still use 1 for, well, steps of 1 that stop at MIN/MAX or loop.
Hopefully I am explaining it correct… essentially keep it as it is, but add that when 0 steps chosen, then every UP/RIGHT sends 1 and every DOWN/LEFT sends -1 (as I think you meant) then a simple:
int x = 0;
x = x + param.asInt();
can act as a counter going either positive or negative.
Because no one would normally pick 0 for steps, whereas right now one can choose in increments of 0.1 and up… Granted, I haven’t tested the BLYNK_WRITE(Vx) results… and if using param.asInt() one would only get integers anyhow… but still, steps of 1 mean 1, steps of 2 mean 2 and so on… I use steps of 1 for precision servo or LED adjustments and never want them to go into the negatives,