How to include AVR library ?

Hi all,

I’m having a problem trying to split my code in many *.c and *.h files.

So, this is the structure of my project:

darksequncer.pde
darksequncer.h
buttons.c

the problem is when I try to use some AVR constant like HIGH or LOW:

#include <avr/wiring.h> 
#include "darksequencer2.h"
...
buttons[i].buttonState = LOW;

I’ve included <avr/wiring.h> to have LOW defined, but when I compile I get this error:

buttons.c:1:25: error: avr/wiring.h: No such file or directory

where am I wrong?

There is no <avr/wiring.h> in any of the include path directories that Arduino uses. Maybe you are thinking about the Arduino wiring.h core header?

Try the following at the top of your .h file and/or your .c file (depending on what is included and from where).

#include <WProgram.h>

That header includes wiring.h and other stuff so that you can access the Arduino core library header stuff.

Regards,

Dave

Yes thanks! My error was seeking in the core headers.

Now it works.