2

Is there a simple way to use the Arduino libraries in Atmel Studio 6 or 7? Already tried it with include path but thats a never-ending story. Looking for a precompiled .a file for the Arduino Due so I only have to include the arduino.h if possible.

Update: I try to build a static library for the Arduino DUE to import it in another project.
I imported a simple sketch and tested it for the UNO which works. New project - Create project from Arduino sketch - select UNO and the sketch. Both projects build (the ArduinoCore and the sketch that has the ArduinoCore lib included).
Just to verify that my steps are correct.
Now for the DUE
Same steps (tested both for DUE programming port and native USB port, both have a red square around (the UNO doesn't)). It seems it creates the project, but I get a lot of compiler errors. 16 in total.

enter image description here

here the sketch. Nothing really complicated

/*Begining of Auto generated code by Atmel studio */
#include <Arduino.h>
/*End of auto generated code by Atmel studio */
//Beginning of Auto generated function prototypes by Atmel Studio
//End of Auto generated function prototypes by Atmel Studio
int count = 0;
void setup() {
 pinMode(13, OUTPUT); // Set pin 13 as an output
 Serial.begin(9600); // Start serial communication at 9600 baud
}
void loop() {
 digitalWrite(13, HIGH); // Turn the LED on
 delay(500); // Wait 500 milliseconds
 digitalWrite(13, LOW); // Turn the LED off
 delay(500); // Wait another 500 milliseconds
 // Print message to the serial monitor
 Serial.print("count: ");
 Serial.println(count);
 count++;
}

Atmel Studio splits the source files from ..\Arduino15\packages\arduino\hardware into a include and a src directory.

I have the files "cortex_handlers.c", "IPAddress.cpp", "main.cpp" ... but not the header files. Would that explain it?

I imported the "chip.h" which solved the last errors but created a few new ones which I am on it.

Is there a simple way to do it, a template or an already precompiled Arduino lib for the DUE?

asked May 30 at 23:31
5
  • 1
    One google search lead me to this. Commented May 31 at 0:57
  • 1
    I found this too but its not what I am looking for. It lets you create ino sketches. I also tried to import a sketch in Atmel Studio but doesnt work because it doesnt accept the path for the Arduino IDE. I already tried to copy all files and set the variables for the paths but only works for non-nested headers. And it requires the cpp-file in the main directory, otherwise it wants the a-file. I can import all files (because they depend on each other) but then I have to go through every file and change the paths. So I was hoping for a already pre-build library. Commented May 31 at 1:15
  • 3
    Well, it allows you to run Arduino framework on Atmel Studio. You could wish what you want but what makes you think your way is the way that will work? BTW, Your comment supposed to be part of your question to explain what you've tried. Commented May 31 at 1:35
  • 2
    @michael86 please add the info to your question and delete the comment Commented May 31 at 6:00
  • While extending your question, please add a minimal, complete and reproducible example that shows the problem. Commented May 31 at 8:34

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.