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
Change the relay pin to the GPIO pin for your relay. | |
Save the contents of relaytoggle.py script to /home/pi/relaytoggle.py | |
Save the contents of relaytoggle.service script to /lib/systemd/system/relaytoggle.service | |
Run the following commands | |
sudo systemctl enable relaytoggle | |
sudo service relaytoggle start |