The bear
Senior Member
Hi Everyone,
The program runs via a 4v5 power supply, so power consumption is not an issue.
It transmits ADC to an indoor blind, open when light & shut at dusk.
What I would like to do is; after dusk (Dark) is to shut down transmission until dawn.
I've tried Setint / interrupt, but that didn't work (No prizes).
Any suggestions would be appreciated, program attached, warts and all!
Thank you, bear..
The program runs via a 4v5 power supply, so power consumption is not an issue.
It transmits ADC to an indoor blind, open when light & shut at dusk.
What I would like to do is; after dusk (Dark) is to shut down transmission until dawn.
I've tried Setint / interrupt, but that didn't work (No prizes).
Any suggestions would be appreciated, program attached, warts and all!
Thank you, bear..
Code:
;HC-12 Master ReadADC v1.1 10.02.18
#Picaxe 08M2 ;Transmit Prog
#No_data ;127 Bytes
#Com 3
;LET dirsC = %0000111
;SETFREQ M4
#Terminal 4800
;HC-12 on Chan 2
; Transmitter in the shed
Symbol baud = T2400_4 ;baud rate to use
Symbol isensor = C.2 ;ADC. input
Symbol outpin = C.4 ;Pin connected to HC-12 RX
Symbol inpin = C.3
Symbol adcval_2 = w2
Symbol adcval_1 = w1
;Symbol counter = b0
Sertxd("HC-12 Master ReadADC v1.1 10.02.18",13,10)
;Sertxd("MARKS TEMP12 v1.3 06.01.18",13,10)
Main:
High outpin ;Do this or the first serout will send rubbish
;From hippy
;Symbol adc_pin = C.2
Do
Readadc isensor, adcval_1
time = 0
Do
Readadc isensor, adcval_2
w1 = w1 + w2 / 2
; Sertxd (#time)
Loop Until time >= 60 ;secs
;Sertxd( #w1, Cr, Lf )
Pause 1000
Serout outpin,baud,(#w1, " ADC")
Pause 100
;Serout outpin,baud,( " ADC ")
;Sertxd( " ADC = ", #w1," ", Cr, Lf )
;Sertxd("ADC = ", w1," ", Cr, Lf )
Pause 2000;0
Loop