Skip to content

Instantly share code, notes, and snippets.

@robinp7720
Created September 26, 2020 20:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robinp7720/fd6b85cbb2cff8fb869bed9cf8067f21 to your computer and use it in GitHub Desktop.
Save robinp7720/fd6b85cbb2cff8fb869bed9cf8067f21 to your computer and use it in GitHub Desktop.
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