I have a project which, to save on battery, is put to sleep until an interrupt pin is rising from LOW to HIGH.
This works well on Arduino Nano, however the translation doesn't on the ATTiny.
#include <avr/sleep.h>
void setup(){
pinMode(2,INPUT);
noInterrupts();
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
attachInterrupt(INT0,wakeUp,RISING);
//Yadada
Interrupts();
}
void wakeUp(){
//Something Something
sleep_mode();
}
Both on the Arduino Nano and the AtTiny, the interrupt Pin 0 is equivalent to Pin 2.
- The Arduino is set to ISP
- I have run the Bootloader (with internal clock as 8MHz if that makes a difference)
- The program loads on the AtTiny45.
Yet, the interrupt pin does not interrupt.
Does the INT0 act differently on a ATTiny than on the Arduino, and if so, how can I wake up my AtTiny?
attachInterrupt(digitalPinToInterrupt(pin), ...