I need ATtiny85 Interrupt code example.
I am trying to implement an Interrupt example using ATtiny85 chip.
Please share an example code.
Configuring Pin7 or PB2 as an Input pin to check for external interrupt on the falling edge (button pressed) and Pin5 or PB0 as Output pin which toggles a LED whenever there is an interrupt on Pin7
Maybe digitalPinToInterrupt hasn't been incorporated into the '85 core.
I don't know what that's supposed to accomplish. (It wasn't around the only time I did with an Interrupt (10 years ago).)
Ok, here is what I have. attachInterrupt is indeed doesn't seem to work, but interrupts on INT0 work. So in this sketch, the internal LED on digispark ATTiny85 I have will light when PB2 is high and turn off when PB2 is low. I used piece of conductor to connect, disconnect ground to PB2
In the case of external interrupt (a.k.a INT0,1);
The ATmega328P requires a level trigger to get up from a power down.
It doesn't support edge trigger wakeups, same to ATtiny85.
There is no point in quoting the data sheet in this case. If you follow the links which have been quoted you will see that Atmel acknowledged a mismatch between the behavior of the ATmega328p and the data sheet.