0

I have a project where it would make a lot of sense to generate Arduino compatible source code, compile it and flash it based on some settings in the project software.

Is there any way to do this without having to rely on the user having installed the Arduino IDE/java?

The ideal would be a self-contained library that could be linked to my C/C++ program.

2

For compiling and uploading Arduino code, you do not need Java, nor the Arduino IDE: you need avr-gcc, avr-libc, the Arduino core library and avrdude. With a proper Makefile, your program just needs to

system("make upload");

C.f. the tutorial Compiling Arduino sketches using Makefile. On an Ubuntu or other Debian-like OS, you would just sudo apt-get install arduino-mk make to get everything you need installed.

1

Have you tried Arduino C Scaffold project?

...the scaffolding lives on Github in the Throw The Switch organization as the Arduino C Scaffold project. This should have everything you need to deploy a C project on an Arduino UNO without the Arduino IDE. If you know your way around Git, you can clone this repository and get to work. If you’d rather not mess with Git right now, you can download the latest revision of the scaffold in a zip file. Once you have the scaffold, take a look at the README. This will walk you through getting the AVR toolchain setup on your environment and describe some of the different ways to use the scaffold. -- https://spin.atomicobject.com/2011/10/15/taking-the-training-wheels-off-the-arduino/

  • Will check it out! – Lennart Rolland Feb 19 '16 at 9:54
  • This seems to be targeted at plain C, not Arduino code. – Edgar Bonet Feb 19 '16 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.