If you want the duty cycle to be as close to 50Hz you can do this to account for the Pulsout statements, Low xx statements, For/next logic and the Pause statement.
Change the Refresh constant value to 20000 'microseconds
Then use this for the pause.
Pauseus Refresh - (((pulse + pulse) + (pulse / 3)) * 10)
This should keep the total duty cycle time to 20ms +/- (~100) microseconds.
Bookmarks