Created
September 26, 2020 20:37
-
-
Save robinp7720/fd6b85cbb2cff8fb869bed9cf8067f21 to your computer and use it in GitHub Desktop.
Replay a logged 433Mhz signal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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