Hmm, I took a look at the code, but see no check to stop the motors when in a balance of the sensors (if they were moving).
Maybe this will help:
This is an idea, not tested.Code:greater: 'greater routine b2 = b0 - b1 'find the difference if b2 > 10 then cw 'is it within the range? if not go to clockwise/ solar panel facing west low PORTB.0 'pin portb.0 low /stopping the solar panel for moving low PORTB.1 'pin portb.1 low / stopping the solar panel for moving goto start 'if it is in the range,do it again lesser: 'lesser routine b2 = b1 - b0 'find the difference if b2 > 10 then ccw 'is it within the range? if not got counter clockwise/solar panel facing east low PORTB.0 'pin portb.0 low /stopping the solar panel for moving low PORTB.1 'pin portb.1 low / stopping the solar panel for moving goto start 'if it is in the range, do it again
Ioannis




Bookmarks