Last active
April 17, 2019 12:40
-
-
Save paulhayes/1b66c0ed8475086c85746e0a12a294a7 to your computer and use it in GitHub Desktop.
HW-677 CH340 USB Relay Module
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 sys | |
import serial | |
import time | |
ser = serial.Serial("COM1", 9600) | |
#Open Relay | |
ser.write( b'\xA0\x01\x01\xA2' ) | |
time.sleep(1) | |
#Close Relay | |
ser.write( b'\xA0\x01\x00\xA1' ) | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment