Skip to content

Instantly share code, notes, and snippets.

@robinp7720

robinp7720/replay.py

Created Sep 26, 2020
Embed
What would you like to do?
Replay a logged 433Mhz signal
from datetime import datetime
from datetime import timedelta
from time import sleep
import sys
import RPi.GPIO as GPIO
TRANSMIT_PIN = 24
GPIO.setmode(GPIO.BCM)
GPIO.setup(TRANSMIT_PIN, GPIO.OUT)
print("replaying...")
print(sys.argv)
file = open(sys.argv[1])
current = 1
for i in file:
sleep(int(i) * 0.000001)
GPIO.output(TRANSMIT_PIN, current)
current = (current + 1) % 2
GPIO.cleanup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.