0

I am trying to include the spi.h file in my project for an Arduino Due. I want to use Atmel Studio 6.2 since it offers me more flexibility and is frankly a much better IDE than the Arduino tool. I can sucessfully program the board using bossa.exe programming utility called from a batch file which communicates with the Arduino. This is the basic call from the batch file:

C:\"Program Files (x86)"\Arduino\hardware\tools\bossac.exe --port=%1 -U false -e -w -v -b %2 -R

Now the issue is, Atmel studio works just fine to program the board if code is left like this:

 #include "sam.h"

 int main(void)
 {
     /* Initialize the SAM system */
     SystemInit();

     while (1) 
     {
         //TODO:: Please write your application code 
     }
 }

BUT the minute I do this:

 #include "spi.h"

the build fails...

spi.h: No such file or directory

BUT when I look in the solution explorer, I can see the sam.h file:

enter image description here

So whats going on here?

(EDIT: I forgot to show the sam.h file in the screen shot, but trust me, its in the folder called "Dependencies")

Hooplator15
  • 1,540
  • 7
  • 31
  • 58

2 Answers2

0

You are missing spi.h header file. Are you sure you have the file available in your machine?

Saagar Elias Jacky
  • 2,684
  • 2
  • 14
  • 28
0

#include "header.h" will look for the header file in the same directory as the file it is being included from (usually, the .c).

#include <header.h> will look for the header in the system-wide standard header include directory.

You can also add custom include search paths for your compiler. Verify that spi.h is available in a location your compiler is aware of!

I don't know the specifics of the IDE you are using, but "Dependencies" seems like a virtual collection of files, not a physical folder.

Joe Terror
  • 101
  • 1
  • 2