
Above is the code I used in the Arduino IDE. Click the Download link to get the text file.

Python 5 volt remote relay.
This file contains hidden or 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
import RPi.GPIO as GPIO | |
import time | |
channel = 21 | |
# GPIO Setup | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(channel, GPIO.OUT) | |
def light_ON(pin): | |
GPIO.output(pin, GPIO.HIGH) | |
def light_OFF(pin): | |
GPIO.output(pin, GPIO.LOW) | |
if __name__ == '__main__': | |
try: | |
light_ON(channel) | |
time.sleep(10) | |
light_OFF(channel) | |
time.sleep(10) | |
GPIO.cleanup() | |
except KeyboardInterrupt: | |
GPIO.cleanup() |


