Wiki - Hardware interrupt

Pin on boards supporting hardware interrupt:

Arduino UNO NANO MINI 2 3        
Arduino Mega2560 2 3 21 20 19 18
Arduino Leonardo 2 3 0 1 7  

- LOW causes an interrupt when the port is LOW.
- CHANGE interrupt is called when the value on the port changes, from LOW to HIGH and vice versa.
- RISING interrupt is called only when the value on the port changes from LOW to HIGH.
- HIGH raises an interrupt when the port is HIGH.
- FALLING interrupt is called only when the value on the port changes from HIGH to LOW.

It is forbidden to use blocks inside a hardware interrupt function:

1.Do not try to use the Time / Delay function.
2.You can get the time by calling Milliseconds, however it will not increase.
3.Do not use the output to Serial-port.
4.Do not try to read data from the Serial-port.

Sample program:

Download example: file.ardublock | Open Online ArduBlock

Video:

Components from Aliexpress

LED

Button

Resistor

Potentiometer

Arduino Pro Mini

Arduino Nano

Arduino Uno

Arduino Uno R3

Arduino Mega

Arduino Leonardo

Bread board

Training set