hi, i made a small programm wich blink a few seconds go to sleep mode the if waked up blink a few second etc...
that s my code:
include <avr/sleep.h>
int i=1;
void setup()
{
pinMode(2, INPUT);
pinMode(13, OUTPUT);
digitalWrite(2,LOW); //for pull down
}
void call_back()
{}
void f_make_it_sleep()
{
set_sleep_mode(SLEEP_MODE_PWR_DOWN);//set sleep parameters
sleep_enable();
attachInterrupt(0,call_back,RISING);
sleep_mode();
sleep_disable();
detachInterrupt(0);
}
void loop()
{ i++;
digitalWrite(13,HIGH);
delay(200);
digitalWrite(13,LOW);
delay(200);
if(i==15)
{
i=0;
digitalWrite(2,LOW); //for pull down again (to be sure)
f_make_it_sleep();
}
}
it doesn't work neither for CHANGES or FALLING (after inversing pull down by pull up)
But it does work perfectly with LOW and the pull down in pull up...
It's a minipro mega168 5v 16mhz
i have no more ideas...
all the 4 kind of interrupt work perfectly on my uno...