Since the Eventor Widget never came for iOS I’m trying to implement some UI for Add and Delete events in a 2D array. I’m using a Time Widget for entering the time and DoW, a Switch to choose the desired action, plus a Button to “Save” the event which will be stored on a Table Widget.
For now it will only Add a weekly event at a particular time and day of the week, plus an action to execute (ON/OFF).
Each button press sends two state changes to the Blynk Function, Press for HIGH, Release for LOW, and since you are not designating one or the other… you get twice the action
And while not necessarily relevant to your issue (or perhaps it is?)… I think you are missing some brackets here… unless there is some fancy coding shortcut that I am unaware of… which happens
I think is should be like this…
BLYNK_WRITE(V41) { //Timer Action Input
// process received value
if (param.asInt() == 1) {
timerAction = ON;
} else {
timerAction = OFF;
}
}
well… it was my understanding that the brackets are only necessary when more than one line of code is going to be executed. If it is just one you can skip them.
Before going into that, and maybe I should open another post because it is a different topic -but related to this very same routine-, I have a question that is killing me:
There is any way to clear the Timer Input widget? I know that…
Blynk.virtualWrite()
…don’t work with the Time Widget, but, there is any way to at least clear the value. I’m trying that once a Event is Saved nothing appears on the Time Widget because is confusing to the user.
You can… and then I can then move relevant posts over there…
Time Input and Timer are different widgets… which one are you referring too?
Not from the hardware that I am aware of… you would have to press Reset (in the App & for both Start and Stop)… but then you MUST account for that in the sketch, as Reset is effectively like an ON / OFF option.
I don’t understand this one… both Time Input and Timer show the settings until someone changes them… well Ok, Timer seems to only show the start time, at least in my tests…
OK, this is the RESET I was referring to… however as far as the sketch is concerned, this can be used as a ON / OFF method… or if incorrectly used, can be misinterpreted as the “wrong” time.
But again, NOT controllable from the Hardware side, as that is not this widgets intended use purpose.
Since you, or assumedly someone close to you, is the user, then just explain to them that what they see is the currently set Start/Stop times and leave it at that
I have the firm intention of going commercial. That’s why I’m building the app.
@Gunner this is getting interesting. How can I CLOSE this issue and mark it as SOLVED and move the last part about the Time Widget to a new Post so the community can benefit from the discussion??
In the mean time…
There is any other methods or workarounds that you are aware off for entering a Time? As I stated before, I want to populate a table of events. This table will be handled by hardware, independently if connected to server or not. But a nice and clean UI is key to succeed in any commercial project. :)
Here is when the Widget falls short. Look at my screenshot: once the user press “ADD” or “AGREGAR” (in Spanish) a new entry appears on the list. If for any reason you get disconnected or just come back latter to the screen, the App keep the value in Time Widget, meaning that the user get confused. My intention is: after the user press ADD (AGREGAR), the time Widget shows nothing. Now it will be clear that the field is ready for a new entry.
In a perfect world, if the Time Widget could be controlled by hardware, I could for further and implement a “EDIT” button: retrieve the values from the table, and show them in the Time Input Widget ready for be changed. At the moment I’m limited to ADD or REMOVE events because of the limitations of the Widget. I’m I explaining myself?
BTW thanks for your quick and asserted responses. Great job!
Thats is fine… however, be aware this “side” of Blynk is the free development side (not allowed in any commercial or for profit use, as per the ToS).
What you are describing needs the commercial side of Blynk, they can certainly do what you need with custom time input, etc. if needed.
Commercial Usage
Blynk applications can not be used for commercial purposes for any fare, fee, rate, charge or other consideration, or directly or indirectly in connection with any business, or other undertaking intended for profit without signing up for Blynk subscription services outlined here: https://www.blynk.io/plans/
Meanwhile you could experiment with Text Input Widget, Terminal, even Segmented Button (days, hours, minutes, seconds) to allow alternative time input methods for testing… Yes, a bit more code, but it is after all for the development of your Apps final methods.