Code for 08M2/AXE131 Couldn't find Code/Code, before Tex tells me off! Got it now "INSERT"
; HC-12 RX Readtemp12 v1.0 09.01.18 CURRENT 10.01.18
;RX
;Marks Readtemp12 v1.0 30.11.17 From Snippets
; 337 Bytes
;Works fine, doesn't simulate temps (C.1)
#Picaxe 08M2 ;AXE131 & DS18B20
#No_data
#Terminal 4800
#Com 3
;Receiver
Sertxd (Cr, Lf,"New HC-12 +Marks Readtemp12 09.01.18")
Symbol baud = T2400 ;baud rate to use
Symbol display = C.0 ;OLED
Symbol inpin = C.3 ;HC-12 TXD
Symbol outpin = C.4 ;HC-12 RXD
Symbol command = b0
Init: ; Initialise OLED output
;Low display
Pause 2000
Serout display,N2400,(254,1) ;Clear screen
Pause 500
Main:
High outpin ;Do this or the first serout will send rubbish
Celsius:
Pause 500
;Serout display,N2400,(254,1) ;Clear screen
Pause 1000
Serin inpin,baud,#w1 'Hash rem for simu.
Pause 500
convert:
Let b9 = 43 'Display + b9 =(43) space b8 =(32)
If w1 > 64655 Then 'info - 55 degrees = 64656
Let b9 = 45 'Display - (45)
w1 = - w1 ;info if - ie w1=1000 display - 10.00 C
Endif
w1 = w1 * 25 / 4 'info + ie w1=8500 display 85.00 C
Bintoascii w1,b8,b7,b6,b5,b4
If b8 = "0" Then : b8 = " " :ENDIF ' zero blanking b8
If b8 = " " And b7 = "0" Then : b7 = " " :ENDIF 'zero blanking b7
Sertxd (Cr, Lf, "Temp",b9,b8,b7,b6,".",b5,b4," Degrees C", Cr, Lf)
Pause 1000
Sertxd( " ", #w1 , "C" )
;Goto celsius
;---------------------------------OLED ADDED
Bintoascii w1,b8,b7,b6,b5,b4
If b8 = "0" Then : b8 = " " :ENDIF ' zero blanking b8
If b8 = " " And b7 = "0" Then : b7 = " " :ENDIF
Pause 100
;Serout display,N2400,(254,130," INDOOR TEMP ") ;AXE133 (ORIGINAL)
;Serout display,N2400,(254,130," OUTDOOR TEMP ") ;AXE133 (ORIGINAL)
Serout display,N2400,(254,130," OUTDOOR") ;AXE131
Pause 100
Serout display,N2400,(254,194, b9," ",b8,b7,b6,".",b5,b4,$D2 ,"C") ;AXE131
;Serout display,N2400,(254,192,"NOW = ", b9," ", b8,b7,b6,".",b5,b4,$D2 ,"C"); AXE133 (ORIGINAL)
; Serout display,N2400,(254,193,"TEMP ",b9 ," ", b8,b7,b6,".",b5,b4,$D2 ,"C") ;AXE133 (ORIGINAL)
Pause 20000 ;Updates Temp ~ 40 Secs.
Goto celsius