peatatnaples
New Member
I have been using a 14M chip to control "use" of power generated by photo-voltaics. As these are 70metres from the house I'ved used a small pv connected to the system to feed in light data. I thought to update using a current sensing transformer on the pv's and wireless transmit the data to the house. XRF seemed quick and easy for the job but I must be doing something wrong. I have been trying to read adc on an 08M2 and transmit this variable to another 08M2 to control an LED. See transmit and receive programmes and attached diagram.
Thanks in anticipation Peat
Thanks in anticipation Peat
Code:
'TRANSMITTER This should read a voltage and send it by XRF
symbol varA = b0
let dirsC = %00010101 'sets inputs & outputs
high C.4 'sets serout pin3 high for XRF
main:
readadc C.1, varA' reads voltage on C.1 (pin6)
serout C.4,T2400_4,(varA)'send voltage out of pin 3 @9600baud
pause 2000' wait a bit
goto main
Code:
'RECEIVER This should get voltage from XRF and use it
symbol varA = b0
let dirsC= %00010101 'sets inputs & outputs
rmain:
serin C.3,T2400_4,varA'receives voltage on pin4 @9600b
if b1 >200 then high C.2 else low C.2 endif 'light diode pin5 if high voltage
pause 2000
goto rmain
Attachments
-
21.8 KB Views: 24