Gday Cire
60? whats that.
Looking at yr diag, i assume the limit switches are used to set the amount of travel for the tracker.
So operation would be
start pointing east
track sun during day
when hit west limit switch stop tracking and wait for sun to go down
quickly slew back to east until hit east limit switch
wait until light again
repeat process
if this is the case i would do this
move the new call to stop tracking so it is checked before anything else
delete the other call to "hold" routine
................
start:
low PORTB.0 'pin portb.0 low
low PORTB.1 'pin portb.1 low
if PORTA.1 = 0 then face_east 'limit switch1 <- move to here
Pot PORTB.2,255,b0 'read first cds sensor
pot PORTB.3,255,b1 'read second cds sensor
................
modify new routines
face_east: '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
sleep 14400 'wait for 4 hours
high PORTB.1 'pin portb.1 high /solar panel back facing east ready for next day sun shine
'Add this next bit to wait until east limit switch closes
' dont go back to start, do all here
hitsw:
if PORTA.2 = 1 then hitsw 'loop until you have hit the switch
'note, now use = 1, ie while sw is open, just keep slewing until it closes
low PORTB.0 'pin portb,0 low / stopping the solar panel for moving
low PORTB.1 'pin portb.1 low / ----- do ----
sound PORTB.4,[124,12000] 'tone
sleep 3600 'wait for 1 hour
goto start 'check again
end
Andrew




Bookmarks