Created
May 9, 2016 16:13
-
-
Save robseward/bfa7db459b38524536145b1b65106665 to your computer and use it in GitHub Desktop.
Running this script with a port name as an argument will restart an Arduino attached to that port
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 serial | |
import sys | |
import time | |
portname = sys.argv[1] | |
ser = serial.Serial('/dev/' + portname, 230400) | |
def reset_arduino(): | |
ser.setDTR(0) | |
time.sleep(0.22) | |
ser.setDTR(1) | |
if __name__ == "__main__": | |
reset_arduino() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment