'** Sun Sensor Code '** Finds highest reading and sends it to flight computer let dirsc = %00110000 symbol CH0 = B0 symbol CH1 = B1 symbol CH2 = B2 symbol CH3 = B3 symbol Value = B4 symbol Heading = B5 Sun_Sensor: readadc 0,CH0 readadc 1,CH1 readadc 2,CH2 readadc 3,CH3 Value = CH0 Heading = 0 Check1: if Value > CH1 then Check2 Value = CH1 Heading = 1 Check2: if Value > CH2 then Check3 Value = CH2 Heading = 2 Check3: if Value > CH3 then Done Value = CH3 Heading = 3 Done: 'debug serout 2,T1200_4,("H",#Heading) goto Sun_Sensor