- Is the loops runs every 20ms, and Analog read function executed for every 20ms and other functions inside also executed depending on index? Will it affect the performance of the program? or some reading may missed. Is it right design of to do?
How are you ensuring that the loops run every 20ms?
- Another idea, instead of Index, i can use time, to call function and read Sensor pin with 2 different loops from main.
Like explained here:
That's a far better idea.