Go Down

Topic: Problem , "fatal error: avr/io.h: No such file or directory" (Read 3538 times) previous topic - next topic

assy

Hi,

i am working with the Arduino Due, using Arduino 1.6.0 and i got this message while compiling

Someone know this problem?
what i need to do?

Thank you, Assy

AWOL

The Due doesn't use the AVR processor.

Quote
and i got this message while compiling
Compiling what?

assy

this my code:


Code: [Select]
// avr-libc library includes


#include <avr/io.h>
#include <avr/interrupt.h>

#define LEDPIN 2
 
void setup()
{
    pinMode(LEDPIN, OUTPUT);
 
    // initialize Timer1
    cli();             // disable global interrupts
    TCCR1A = 0;        // set entire TCCR1A register to 0
    TCCR1B = 0;
 
    // enable Timer1 overflow interrupt:
    TIMSK1 = (1 << TOIE1);
    // Set CS10 bit so timer runs at clock speed:
    TCCR1B |= (1 << CS10);
    // enable global interrupts:
    sei();
}


ISR(TIMER1_OVF_vect)
{
    digitalWrite(LEDPIN, !digitalRead(LEDPIN));
}

void loop() {
}


this is the Error message :
fatal error: avr/io.h: No such file or directory
compilation terminated.
Error compiling


Moderator edit: And there's your code with CODE TAGS.

AWOL

Code: [Select]
#include <avr/io.h>
#include <avr/interrupt.h>

Have you ever seen those directives in any other Due sketch?
Have you ever wondered why?

assy

You right , can't do it with the Due board
i changed it to Arduino Mega and everything OK.

Thank you :)

Go Up