Skip to content

Instantly share code, notes, and snippets.

@nooges
Created September 15, 2016 20:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nooges/75c63b624bc93af3493a4c7877589ecb to your computer and use it in GitHub Desktop.
Save nooges/75c63b624bc93af3493a4c7877589ecb to your computer and use it in GitHub Desktop.
Script to flash Pro Micro controller
#!/bin/sh
dfuport=$(ls -rt /dev/tty.usb* | tail -n1)
echo "Device tty: $dfuport"
if [ -z "$dfuport" ]; then
echo "Bootloader not detected"
else
avrdude -p atmega32u4 -P $dfuport -c avr109 -U flash:w:$1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment