From bf09a18e5126dcf74beb3f383209726b4c231e64 Mon Sep 17 00:00:00 2001 From: "S. Seegel" Date: Tue, 29 Sep 2015 10:15:00 +0000 Subject: [PATCH] Added intertechno --- intertechno.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 intertechno.py diff --git a/intertechno.py b/intertechno.py new file mode 100644 index 0000000..c15b663 --- /dev/null +++ b/intertechno.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python2.7 + +from rfm69 import Rfm69 +import rfm69 +import sys +import time + +if len(sys.argv) != 2: + print "usage: intertechno " #12-digit code 12 * ['0', '1', 'f'] + sys.exit(1) + +rfm = Rfm69() +rfm.SetParams( + Freq = 433.92, + Datarate = 2.666666, + TXPower = 13, + ModulationType = rfm69.OOK, + SyncPattern = [0x80, 0x00, 0x00, 0x00] + ) + +#Frame generation +def MakeFrame(code, rep): + data = [0x80, 0x00, 0x00, 0x00] #sync + b = 0; + for c in code: + if c == '0': + data.append(0x88) + elif c == '1': + data.append(0xEE) + elif c == 'F' or c == 'f': + data.append(0x8E) + + result = [] + for i in range(rep): + result += data + return result + +data = MakeFrame(sys.argv[1], 3) +rfm.SendPacket(data)