I am monitoring the frequency of VFO A on an amateur radio transceiver by connecting my 14M2 programming port to a utility that monitors VFO A and provides a continuous output in the following ASCII character format at 4800 baud:
"FAxxxxxxxxxxx;", where x is a decimal digit 0-9
Here is an excerpt from the code using the serrxd command:
; THE CODE
; First let's define some helpful symbols.
; The PICAXE outputs to be used to control the six antennas:
symbol ANT1 = B.0
symbol ANT2 = B.1
symbol ANT3 = B.2
symbol ANT4 = B.3
symbol ANT5 = B.4
symbol ANT6 = B.5
; Temporary storage for the decimal values of the eleven ASCII numbers (0-9) and
; calculations:
symbol X1 = b0
symbol X10 = b1
symbol X100 = b2
symbol K = b3
symbol K10 = b4
symbol K100 = b5
symbol M = b6
symbol M10 = b7
symbol M100 = b8
symbol G = b9
symbol G10 = b10
symbol MHz = b11
main:
; Input VFO A frequency and save decimal values of the eleven ASCII numbers (0-9).
SERRXD ("F","A"),#G10,#G,#M100,#M10,#M,#K100,#K10,#K,#X100,#X10,#X1
; Test to see if anything is stored. The specified antenna LED will light if so.
if G10 <> 0 then high ANT2 else low ANT2 endif
if G <> 0 then high ANT3 else low ANT3 endif
if M100 <> 0 then high ANT4 else low ANT4 endif
If M10 <> 0 then high ANT5 else low ANT5 endif
if M <> 0 then high ANT6 else low ANT6 endif
goto main
What puzzles me is that if I substitute = for <>. I get the same result, no LEDs light. This does't make any sense. For example, how can G10 both = zero and <> 0 ?
Am I specifying "FA" correctly? Should it be "F","A" or "FA"?
"FAxxxxxxxxxxx;", where x is a decimal digit 0-9
Here is an excerpt from the code using the serrxd command:
; THE CODE
; First let's define some helpful symbols.
; The PICAXE outputs to be used to control the six antennas:
symbol ANT1 = B.0
symbol ANT2 = B.1
symbol ANT3 = B.2
symbol ANT4 = B.3
symbol ANT5 = B.4
symbol ANT6 = B.5
; Temporary storage for the decimal values of the eleven ASCII numbers (0-9) and
; calculations:
symbol X1 = b0
symbol X10 = b1
symbol X100 = b2
symbol K = b3
symbol K10 = b4
symbol K100 = b5
symbol M = b6
symbol M10 = b7
symbol M100 = b8
symbol G = b9
symbol G10 = b10
symbol MHz = b11
main:
; Input VFO A frequency and save decimal values of the eleven ASCII numbers (0-9).
SERRXD ("F","A"),#G10,#G,#M100,#M10,#M,#K100,#K10,#K,#X100,#X10,#X1
; Test to see if anything is stored. The specified antenna LED will light if so.
if G10 <> 0 then high ANT2 else low ANT2 endif
if G <> 0 then high ANT3 else low ANT3 endif
if M100 <> 0 then high ANT4 else low ANT4 endif
If M10 <> 0 then high ANT5 else low ANT5 endif
if M <> 0 then high ANT6 else low ANT6 endif
goto main
What puzzles me is that if I substitute = for <>. I get the same result, no LEDs light. This does't make any sense. For example, how can G10 both = zero and <> 0 ?
Am I specifying "FA" correctly? Should it be "F","A" or "FA"?