'{$STAMP BS2} '{$PBASIC 2.5} ' PROGRAM: BS2SX Dashboard Decoder ' Written by: Jacob Komar ' Date: 03/0/3/06 '************************************************** Input 16 Output 0 Output 1 Output 2 Output 3 Output 4 Output 5 Output 6 Output 7 Output 8 Output 9 Output 10 Output 11 Output 12 Output 13 Output 14 Output 15 '************************************************** bye03 var byte bye04 var byte bye05 var byte bye06 var byte bye07 var byte ctrl_a var byte bye09 var byte ctrl_b var byte bye11 var byte ctrl_c var byte bye13 var byte bye14 var byte bye15 var byte bye16 var byte bye17 var byte bye18 var byte bye19 var byte bye20 var byte bye21 var byte bye22 var byte bye23 var byte bye24 var byte bye25 var byte bye26 var byte last var bit test var byte '************************************************** '************************************************** last = 1 main: 'This is Packet 1, reading PWM 1 if ctrl_c.bit7=0 AND ctrl_a.bit4=0 then if bye03>150 then last = 1 else last = 0 endif endif endif 'if bye05 > 150 then ' last = 1 'else ' last = 0 'endif out7 = last goto send_packet: '************************************************** timeout: Toggle 8 goto send_packet: '************************************************** send_packet: SERIN 16,16416,4000,timeout,[WAIT($FF,$FF), bye03, bye04, bye05, bye06, bye07, ctrl_a, bye09, ctrl_b, bye11, ctrl_c, bye13, bye14, bye15, bye16, bye17, bye18, bye19, bye20, bye21, bye22, bye23, bye24, bye25, bye26] goto main: