I do not plan on using interrupts. The sequence goes something like this:
Code: Select all
Start
sample A/D 1 and calculate delay time 1
sample A/D 2 and calculate delay time 2
Clear and start timer 1
do other functions
read timer 1
is timer 1 > calculated delay time 1 (if yes then switch output and check for delay time 2)
(if not go to do other functions)
Sample A/D 1
is sample 1 < or > last sample value (if yes, calculate new time switch output if new timer < current timer time)
(if not go to do other functions)
Thanks, Dan