Created
April 17, 2017 21:03
-
-
Save lalten/d6297042643d6823aa27560d6ada5c65 to your computer and use it in GitHub Desktop.
Reset Arduino Micro via python serial
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
#!/usr/bin/env python | |
import serial | |
port='/dev/ttyACM0' #adjust this in case your device differs | |
ser = serial.Serial() #open serial connection | |
ser.port=port #setting the port accordingly | |
#in case your usual baudrate isn't 9600 reset will not work, therefore we will open a resetable connection | |
#thanks to mattvenn.net for suggesting to add this step! | |
ser.baudrate=9600 | |
ser.open(); ser.close() | |
ser.baudrate=1200 # set the reset baudrate | |
ser.open(); ser.close() | |
#don't forget to sleep some reset time |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment