title: Compile and upload to Arduino programmatically
body: <p>I know basic arduino development using the default Arduino IDE. I am using the Arduino Pro Mini 5V board for my project.</p>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <pre><code>/////////////////////////////////////////////////////
  // 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
  }
  </code></pre>