You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You use an interrupt to determine the time to change to the next frequency. However the actual frequency change is performed on the main loop. I understand interrupts are used to get a precise 'interrupt_time' of 10 ms intervals to set the next frequency.
However I think that given how it works you should be able to do the same by just storing the last millis() as a multiple of 'interrupt_time' and checking whether the next millis() multiple is greater than that. I think it works the same as the 'fired' variable in your code because millis() value is interrupt-generated anyway.
That approach would greatly simplify the code and make it more portable. Does this make sense to you?
Thanks
The text was updated successfully, but these errors were encountered:
You use an interrupt to determine the time to change to the next frequency. However the actual frequency change is performed on the main loop. I understand interrupts are used to get a precise 'interrupt_time' of 10 ms intervals to set the next frequency.
However I think that given how it works you should be able to do the same by just storing the last millis() as a multiple of 'interrupt_time' and checking whether the next millis() multiple is greater than that. I think it works the same as the 'fired' variable in your code because millis() value is interrupt-generated anyway.
That approach would greatly simplify the code and make it more portable. Does this make sense to you?
Thanks
The text was updated successfully, but these errors were encountered: