How many simultaneous timers
Posted:
Sat Jul 09, 2016 9:29 pm
by Pradeep
Hi
I am extremely happy with ESP BASIC development.
Can we run more than one timer at the same time to carryout two different tasks?
Thanks
Pradeep
Re: How many simultaneous timers
Posted:
Thu Jul 28, 2016 11:42 am
by Oldbod
Did you come to a happy conclusion about this? I'd probably assume that it was possible to add a second timer command (eg timer2) to basic pretty easily, a little more complex to add a multitimer function (like timer(n,1000) ). You just have to avoid unwanted interference.
But you can add the same functionality yourself pretty easily. one way, you set the timer function to a convenient value, something equal to or less (say half for instance) than the minimum value you'll actually need. Then in your timer called subroutine, you check to see if it's time to do whatever you want to do for each item. There are many ways to do that, and as long as you're not trying to do too much for the processor keep up, you'll be fine. And because you've got control, you can avoid unwanted triggers....
Re: How many simultaneous timers
Posted:
Thu Jul 28, 2016 5:25 pm
by Mmiscool
I think i could add more timerers pretty easly.
If i dont add more in the next build please reminde me.
Re: How many simultaneous timers
Posted:
Sun Jul 31, 2016 12:34 pm
by lew247
I second that more than one timer would be very handy