'***************** 'Meter Monitor Tx '433MHz Jaycar Transmitter 'Picaxe 08M2 or 08M 'Phillip Webb 2012 '***************** 'Internal Clock speed setfreq m16 'Variables symbol temp = w4 symbol secscount = w5 symbol values = w6 'Constants Symbol DataLED = c.4 'LED flashes when transmitting Symbol TxOut = c.1 ' High to Transmit setint %00000000 ,%00001000 ' pin 3 int on low (pulse in) '*************************** Main: pause 39 'approx 10 ms pause - allow for loop overhead.- remeber clock is 4 time 4 MHz secscount = secscount + 1 ' counter goto main '*************************** Interrupt: high dataled if secscount >100 then'add small calibration factor temp = secscount temp = secscount /100 secscount = secscount + temp end if 'break count into Bytes b0 = secscount /1000 ' 1000's secscount = secscount//1000 b1 = secscount /100' 100's secscount = secscount //100 b2 = secscount /10 ' 10's b3 = secscount //10 call transmit secscount = 5' reset seconds counter allow 10 ms for tx do loop until pin3 = 1 ' until pulse is finished to prevent re- trigger of Int. low dataled setint %00000000, %00001000 return '*************************** Transmit: High TxOut 'Tx on pause 16 'Tx delay for Rx to sense the Transmission and set AGC on Low TxOut 'Tx off only for short period to keep Rx AGC low level to avoid noise Rx Serout TxOut , N2400_16, ("MM1",b0,b1,b2,b3) 'Send Station identifier and Data Low TxOut 'Switch Tx off. Save Power Rx AGC will be high gain thus Rx noise return '***************************