muzakyo, I don't see anywhere in your code that you are stopping the motor if your system is "on target". You need to place some kind of DEAD BAND limits that are within the ON TARGET criteria. I mean +- so many counts... You should have at least 4 states, 1 for sleep (waiting for next morning), 1 for going east, 1 for going west and 1 for stop during the day when system is on target.
Dave Purola,
N8NTA
Bookmarks