1

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
}
2
  • Hints: Use makefile for compilation (you can possibly use makefile from existing project or create a new one using IDE, if not familiar with Makefile structure.) & possibly avrdude or similar command line tool for uploading the program on the arduino. Commented May 21, 2014 at 8:51
  • 5
    the code you posted is totally irrelevant for your question. Commented May 21, 2014 at 9:03

2 Answers 2

2

Have you tried Ino?. It's a command line toolkit to build and upload Arduino sketches. They have a really good Getting Started Guide.

Sign up to request clarification or add additional context in comments.

Comments

0

avrgirl is a library that might do what you want. Since I need to upload to ESP32, I'm going to try using Arduino-CLI which seems to allow it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.