How to use evive’s Interrupt pins

evive Fritzing
About This Tutorial
This tutorial discusses what are interrupts, and how to use evive’s interrupt pins in Arduino IDE with the help of an Arduino IDE sketch.
Tutorial Info

Components Required

Image Component Quantity Available in Kit
evive 1
USB A-B Cable 1


In programming, an interrupt is a signal that a hardware or software sends to the processor alerting it of an event that needs immediate attention. An interrupt alerts the processor to a high-priority condition requiring the interruption of the current code the processor is executing. The processor responds by stopping all of its current activities, saving its state, and executing a function called an interrupt handler (or an interrupt service routine, ISR) to deal with the event. This interruption is temporary, and, after the interrupt handler finishes, the processor resumes its normal activities.

evive has 6 external interrupt pins:

  • 2 (interrupt 0)
  • 3 (interrupt 1)
  • 18 (interrupt 5)
  • 19 (interrupt 4)
  • 20 (interrupt 3)
  • 21 (interrupt 2)

These pins can be configured to trigger an interrupt on a LOW level, a rising or falling edge of a PWM signal, or a change in level.


In Arduino IDE environment you can attach interrupts using the attachInterrupt() function. There are two different approaches with which you can initialise an interrupt pin:

attachInterrupt(digitalPinToInterrupt(pin), ISR, mode); 


attachInterrupt(interrupt, ISR, mode);


  •  interrupt is the number of the interrupt pin (from 0-5)
  • pin is the pin number
  • ISR is the function that you call when interrupt occurs (this function do not take parameters, and returns nothing. This function is also called an interrupt service routine)
  • mode defines how the interrupt occurs.

There exist several modes, as shown in the table below:

Trigger TypeTrigger Action
LOWTrigger the interrupt whenever the pin is low
CHANGETrigger the interrupt whenever the pin value changes
RISINGTrigger when the pin goes from low to high
FALLINGTrigger when the pin goes from high to low


When we don’t need any kind of interrupt we can stop it, or override it by using the detachInterrupt() function. There are two ways to use it:





This example demonstrates the use of interrupts in evive. For this, you must connect digital pins 2 and 7 using a jumper wire. In this program, we will control the Pin 13 LED using evive’s push button 1, i.e. tactile switch 1, and interrupt pin.

Below is the Arduino IDE sketch:

Share this Tutorial
Share on facebook
Share on twitter
Share on pinterest
Share on reddit
Share on print
Featured Projects

Leave a Reply