Page 1 of 1

Time Limit For Setter Functions?

Posted: 18 Feb 2018 03:01
by Tillsy
Is there an automatic time limit for setter functions?

I have a specific situation where a second task may sometimes need to happen say 10 seconds later - have a time loop running because delay function not allowed, but it seems my code never gets to finish so it seems the code gets terminated?

Re: Time Limit For Setter Functions?

Posted: 18 Feb 2018 10:54
by Tillsy
Found the problem - seems either Z-UNO or Arduino do adhoc calculations as int. I had to first create a float and do the calculations within that first.

Otherwise my percentages were calculating as zero every time and the whole thing immediately timing out.

Plus by doing this calculation with a float variable, I can monitor that from the main loop and can do the second task there. Thus the setter function is finished within 100ms worse case (still something that needs to delay by 75ms, no escaping that).

Re: Time Limit For Setter Functions?

Posted: 18 Feb 2018 19:35
by PoltoS
We suggest to exit the setter asap.