I know basic arduino development using the default Arduino IDE. I am using the Arduino Pro Mini 5V board for my project.
I need to be able to compile and upload the program onto the board programmatically (rather than using the buttons in the Arduino IDE). As an experiment, I have written a basic "blink LED" sample code that I want to be able to compile and then upload to the Arduino Pro Mini board - all programmatically - rather than through the default Arduino IDE.
How can I compile and upload the code to the Arduino Pro Mini through avrdude through a terminal rather than using the native Arduino IDE?
/////////////////////////////////////////////////////
// BLINK LED ON ARDUINO PRO MINI (5V)
//
// http://arduino.cc/en/Main/ArduinoBoardProMini
/////////////////////////////////////////////////////
// For blinking an LED in arduino Pro Mini 5V
int blink_led = 13;
// the setup routine runs once when you press reset:
void setup() {
// Blink LED is an output pin.
pinMode(blink_led, OUTPUT);
}
void loop() {
// BLINK LED
digitalWrite(blink_led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(50); // wait for a second
digitalWrite(blink_led, LOW); // turn the LED off by making the voltage LOW
delay(50); // wait for a second
}
makefilefor compilation (you can possibly use makefile from existing project or create a new one using IDE, if not familiar with Makefile structure.) & possiblyavrdudeor similar command line tool for uploading the program on the arduino.