;From PicAxe Forum viasHippy"
;Latest Iteration @ 19-11-019
#Picaxe 08M2
#Terminal 4800
#No_Data
Symbol TX_PIN = C.1
Symbol RX_PIN = C.2
Symbol direction = w1 ; b3:b2
Symbol dir.lsb = b2
Symbol dir.msb = b3
PowerOnReset:
Pause 2000
SerTxd( "Started", CR, LF )
MainLoop:
Do
High TX_PIN
SetFreq M32
Pause 100
SerOut TX_PIN, T9600_32, ( $13 ); Get Bearing CMPS Code 0x13
SerIn [16000,Timedout], RX_PIN, T9600_32, dir.msb, dir.lsb
SetFreq MDEFAULT
Pause 100
SerTxd( "Direction=", #direction, CR, LF )
Pause 1000
Loop
Timedout:
SetFreq MDEFAULT
Pause 100
SerTxd( "Timed out", CR, LF )
Goto MainLoop
;Hippy results of Test
;Terminal says Started and from there On says TimedOut
;Latest Iteration @ 19-11-019
#Picaxe 08M2
#Terminal 4800
#No_Data
Symbol TX_PIN = C.1
Symbol RX_PIN = C.2
Symbol direction = w1 ; b3:b2
Symbol dir.lsb = b2
Symbol dir.msb = b3
PowerOnReset:
Pause 2000
SerTxd( "Started", CR, LF )
MainLoop:
Do
High TX_PIN
SetFreq M32
Pause 100
SerOut TX_PIN, T9600_32, ( $13 ); Get Bearing CMPS Code 0x13
SerIn [16000,Timedout], RX_PIN, T9600_32, dir.msb, dir.lsb
SetFreq MDEFAULT
Pause 100
SerTxd( "Direction=", #direction, CR, LF )
Pause 1000
Loop
Timedout:
SetFreq MDEFAULT
Pause 100
SerTxd( "Timed out", CR, LF )
Goto MainLoop
;Hippy results of Test
;Terminal says Started and from there On says TimedOut