Skip to content

Instantly share code, notes, and snippets.

@lalten
Created April 17, 2017 21:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lalten/d6297042643d6823aa27560d6ada5c65 to your computer and use it in GitHub Desktop.
Save lalten/d6297042643d6823aa27560d6ada5c65 to your computer and use it in GitHub Desktop.
Reset Arduino Micro via python serial
#!/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