Time-based transactions

I have only one button. As soon as I press the button, data A in firebase will be 1.
Half a second after pressing the button, B data in firebase will be 1
1 second after pressing the button, the C data in the firebase will be 1, and after the C data becomes 1 for 2 seconds, all of them will return to 0, that is, it will return to the initial state.

How do I do this?

Use a clock timer, setting its timer Interval for each transaction.

Bear in mind it will probably take up to a couple of seconds for firebase to update/return...

1 Like

You will either have to use three single-shot Clocks (one per step), or add some global variables where you can set what Clock1 should do the next time it fires:

  • what step number you are up to (start at 1)
  • how long until the next time it fires (0 if done)
  • what it should set for A
  • what it should set for B
  • what it should set for C

In retrospect, all you need is the step number. The rest you can hard code in an if/then/elseif tree based on the step value.

1 Like