Raspberry pi relay via ssh python code

Channel:
Subscribers:
157
Published on ● Video Link: https://www.youtube.com/watch?v=uKcXBKNvFMo



Duration: 0:30
77 views
0


Control a 5v relay with a raspberry pi ssh.
Simple python code:
import time

import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)
GPIO.setup(19, GPIO.OUT)
GPIO.output(19, GPIO.HIGH)

time.sleep(1)
GPIO.output(19, GPIO.LOW)

time.sleep(1)

GPIO.output(19, GPIO.HIGH)

time.sleep(1)
GPIO.cleanup()

Replace gpio pin in the code (19) by the one you use.







Tags:
raspberry pi
gpio
2019
ssh
pi
python
code
relay
pin
program
water
pump