Giter Club home page Giter Club logo

arduino-pcimanager's Introduction

Introduction

With PciManager Arduino library you can manage the Pin Change Interrupt of the microcontroller. You can register listeners in the PciManager for a change of a pin. The manager handles the interrupt and calls the listeners.

PciManager does not read the value of the pin, it just hides dirty hardware flags, but flexible enough to use multiply listeners on multiply pins.

NOTE: On some hardware the pin change interrupt is not implemented by interrupt vectors. As PciManager operates with interrupt vectors, it will just not do the job on hardware like this.

Example code

#include <PciManager.h>
#include <PciListenerImp.h>

#define INPUT_PIN 3

PciListenerImp listener(INPUT_PIN, onPinChange);


void setup() {
  Serial.begin(9800);
  PciManager.registerListener(INPUT_PIN, &listener);
  Serial.println("Ready.");
}

void onPinChange(byte changeKind) {
  Serial.print("pci : ");
  Serial.println(changeKind);
}

void loop() { }

arduino-pcimanager's People

Contributors

per1234 avatar prampec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino-pcimanager's Issues

Errors when using together with SoftwareSerial in Arduino 1.0.2

What steps will reproduce the problem?
1. just include SoftwareSerial.h and PciManager (PciManager.h and 
PciListenerImp.h)


We get a bunch of errors like:
PciManager\PciManager.cpp.o: In function `__vector_3':
Arduino\libraries\PciManager/PciManager.cpp:144: multiple definition of 
`__vector_3'
SoftwareSerial\SoftwareSerial.cpp.o:D:\work\_Arduino\arduino-1.0.2\libraries\Sof
twareSerial/SoftwareSerial.cpp:302: first defined here
PciManager\PciManager.cpp.o: In function `__vector_4':
Arduino\libraries\PciManager/PciManager.cpp:147: multiple definition of 
`__vector_4'
SoftwareSerial\SoftwareSerial.cpp.o:D:\work\_Arduino\arduino-1.0.2\libraries\Sof
twareSerial/SoftwareSerial.cpp:309: first defined here
PciManager\PciManager.cpp.o: In function `__vector_5':
Arduino\libraries\PciManager/PciManager.cpp:150: multiple definition of 
`__vector_5'
SoftwareSerial\SoftwareSerial.cpp.o:D:\work\_Arduino\arduino-1.0.2\libraries\Sof
twareSerial/SoftwareSerial.cpp:316: first defined here


Tested on Arduino 1.0.2, Windows version.



Original issue reported on code.google.com by [email protected] on 3 Dec 2012 at 12:39

Conflict between Pcimanager & SoftwareSerial

I want to use SoftTimer and SoftwareSerial together. To use SoftTimer, I have to also include PciManager.h. But if I include both PciManager.h and SoftwareSerial.h, I get a stream of ld errors (sample below). I am using latest releases of SoftTimer & PciManager (3.1.0 and 2.1.0 respectively), and the SoftwareSerial that's built-in to Arduino IDE 1.6.5.

Compile output follows:

Arduino: 1.6.5 (Mac OS X), Board: "Arduino/Genuino Uno"

PciManager/PciManager.cpp.o: In function __vector_3': /Users/twilson/Documents/Arduino/libraries/PciManager/src/PciManager.cpp:144: multiple definition of__vector_3'
SoftwareSerial/SoftwareSerial.cpp.o:/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:227: first defined here
PciManager/PciManager.cpp.o: In function PciManagerClass::remove(PciListener*)': /Users/twilson/Documents/Arduino/libraries/PciManager/src/PciManager.cpp:63: multiple definition of__vector_4'
SoftwareSerial/SoftwareSerial.cpp.o:/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:392: first defined here
PciManager/PciManager.cpp.o: In function PciManagerClass::remove(PciListener*)': /Users/twilson/Documents/Arduino/libraries/PciManager/src/PciManager.cpp:63: multiple definition of__vector_5'
SoftwareSerial/SoftwareSerial.cpp.o:/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:392: first defined here
collect2: error: ld returned 1 exit status
Error compiling.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.