Skip to content

Instantly share code, notes, and snippets.

@RichardBronosky
Last active October 17, 2016 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RichardBronosky/0500556194a45f2d4855 to your computer and use it in GitHub Desktop.
Save RichardBronosky/0500556194a45f2d4855 to your computer and use it in GitHub Desktop.
Arduino tools
# Does the Easter Egg reset of a Leonardo, Micro, or Sparkfun Pro Micro
# I really wish it didn't require 8 seconds to get to the user code.
# If you have a solution to that, please share.
for f in /dev/tty.usbmodem*; do
echo Restting $f;
stty -f $f 1200;
done;
for i in {8..1}; do
echo -n "$i ";
sleep 1;
done;
echo " Complete."
# Creates and opens a new Arduino project
args="${*}"
name="${args// /_}"
mkdir $name
touch $name/$name.ino
open $name/$name.ino
@RichardBronosky
Copy link
Author

A suggestions from sudar/Arduino-Makefile#30 (comment) would avoid the 8 second wait. I've yet to try it.

import serial
import sys
ser = serial.Serial()
ser.port = sys.argv[1]
ser.baudrate = 1200
ser.open()
ser.setDTR(0)
ser.close()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment