I have been using the HC-12 as a very simple remote for a while, works ok. However I dont understand why my variable b0 which is transmitted as a 1 becomes 6 on the receive side?
I have found like others that the newer HC-12 can only be used as pairs are discussed elsewhere. When I use an older HC-12 I get a number of 64 for b0?
Not sure what I've got wrong, can anyone guide me please. Peter
I have found like others that the newer HC-12 can only be used as pairs are discussed elsewhere. When I use an older HC-12 I get a number of 64 for b0?
Not sure what I've got wrong, can anyone guide me please. Peter
Code:
output C.0,C.2
input C.3,C.4,C.5, C.1
'TX Same program below working on both TOGGLE and HIGH OUTPUT when SWITCH PRESSED 3-5-18. THIS VERSION IS SWITCH ON/OFF ONLY
do
If pinc.4 = 1 then 'press c.4 switch to operate
b0 = 1 pinc.2 = 1 else b0 = 0 pinc.2 = 0 endif 'Checking b0 to put C.2 high to confirm b0 is 1
sertxd("The value of b0 is ",#b0,13,10)
serout C.1, N2400, (b0)
loop
'RX below for high output on C.2 only when input switched on WORKING 3-5-18
do
b0 = 0
serin c.4, N2400, b0
sertxd("The value of b0 is ",#b0,13,10)
if b0 = 0 then low C.2 else high C.2 endif 'Checking b0 number, should be 1 but why 6? LED on and relay switched by C.2
pause 100
loop