Attiny84 and attachinterrupt Rising


hello,

i try make interrupt attiny84.
my code ok interrupt low doesn't work rising , falling , hight .
i use tiny core :https://code.google.com/p/arduino-tiny/
do know problem?

code: [select]
#include <avr/sleep.h>

// ====================================================
void system_sleep()
{
sleep_enable(); // ready sleep
sleep_mode(); // go to  sleep
sleep_cpu();
// sleeping ...
}

// ====================================================
void wake()
{
  sleep_disable(); // wake fully
  digitalwrite(3, high);
  delay(500);
  digitalwrite(3, low);
  delay(500);
}

// ====================================================
void setup()
{
set_sleep_mode(sleep_mode_pwr_down);
pinmode(2, input);
  pinmode(3, output);
attachinterrupt(0, wake, rising );
system_sleep();

}

// ====================================================
void loop()
{
}


thanks

does sleep mode have selected disable i/o clock? comment out sleep code , see if starts working.
maybe need pulldown resistor on int0 pin prevent floating high?


Arduino Forum > Using Arduino > Microcontrollers > Attiny84 and attachinterrupt Rising


arduino

Comments