Skip to content
An Arduino library to handle Pin Change Interrupts
C++ Shell
Branch: master
Clone or download
Kees Bakker
Latest commit 5297321 Jun 17, 2015

README.md

PcInt Library

This is an Arduino library to administrate and handle Pin Change Interrupts.

Examples

... TODO ... Here is a quick example to get you started

#include <Sodaq_PcInt.h>
void setup()
{
  pinMode(A0, INPUT_PULLUP);
  PcInt::attachInterrupt(A0, handleA0);
}

void loop()
{
  // ...
}

static uint8_t rain1ticks;
void handleA0()
{
  static bool rain1State;
  //rain counter 1
  if (digitalRead(A0) == LOW) {
    if (!rain1State) {
      rain1ticks++;
      rain1State = true;
    }
  } else {
    rain1State = false;
  }
}

Most important functions

  • PcInt::attachInterrupt
You can’t perform that action at this time.