Hi,
I have a statement in a pgm:
Init_HC12
which is preceded by two macros:
When I run the pgm AAAA is written to the Serial Terminal followed by a never ending series of hex-codes - but neither BBBB nor CCCC appear. Can anyone see what is happening here?
best regards
torben
I have a statement in a pgm:
Init_HC12
which is preceded by two macros:
Code:
#macro Talk_HC12(msg)
;
; Send commands to the HC-12
;
sertxd ("CCCC",cr,lf) ;that we can get here before it sends its response. *****************
gosub Clear_Response_Buffer ;Clear out the buffer we use
Serout TX_Pin,HC12BaudRate,(msg) ;send the command
gosub Get_Response ;and accept the returned data. The HC-12 is slow enough,
Pause FortymS ;wait to 'ensure' HC-12 has accepted the command
#endm
#macro Init_HC12
;
; Initialise HC-12.
;
low HC12_set ;take set pin low - Enter Command Mode
Pause FortymS ;wait 40mS
;
; Some sample commands you might use...
;
sertxd ("AAAA",cr,lf) ;that we can get here before it sends its response. *****************
Talk_HC12("AT") ;just a bit of a clearout, of any rubbish in the buffer
sertxd ("BBBB",cr,lf) ;that we can get here before it sends its response. **********************
Talk_HC12("AT+P8") ;20dBm - 100mW
Talk_HC12("AT+C064") ;458.6MHz
high HC12_set ;take set pin high, which actions the command(s)
Pause EightymS ;wait 80mS for any changes to take effect, before entering pass-thru
#endm
best regards
torben