Skip to content

Instantly share code, notes, and snippets.

@jbobrow
Last active September 19, 2019 19:15
Show Gist options
  • Save jbobrow/b7036785d33b6a641e050dc29a48872a to your computer and use it in GitHub Desktop.
Save jbobrow/b7036785d33b6a641e050dc29a48872a to your computer and use it in GitHub Desktop.
Drag'n'Drop Blinks Uploader
//--------------------------------------------------------------
void ofApp::dragEvent(ofDragInfo dragInfo){
// Retrieve the path of the single file dropped on our window
filepath = dragInfo.files[0];
// Create a string for the entire command needed to load FW onto a Blink
commandString = "avrdude -p m168pb -P usb -c usbtiny -U flash:w:" + filepath;
// Convert string to const char * as system requires parameter of type const char *
const char *command = commandString.c_str();
// Call the command from the command line
system(command);
/*
getting error "sh: avrdude: command not found"
is this helpful? https://github.com/qmk/qmk_firmware/issues/4120
or this https://stackoverflow.com/questions/12694302/upload-sketch-with-c
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment