TinyPinChange is an asynchronous (interrupt-driven) library designed to detect event (rising or falling edege) on pins.
Very often in the arduino world, users complain about conflicts between libraries.
This TinyPinChange library allows to share the "pin change interrupt" vector for several "clients".
For example, it's possible to use the SoftRcPulseIn library whilst using the SoftSerial library: both libraries rely on the TinyPinChange library.
- Event detector (on pins)
- Frequency meter
- Pulse width meter
- Tachometer
- Duty cycle measurement
- Software serial port (see SoftSerial library which relies on TinyPinChange)
- ATmega368 (UNO)
- ATmega2560 (MEGA)
- ATtiny84 (Standalone)
- ATtiny85 (Standalone or Digispark)
- ATtiny167 (Digispark pro)
- ATmega32U4 (Leonardo, Micro, Pro Micro)
Develop your project on an arduino UNO or MEGA, and then shrink it by loading the sketch in an ATtiny or Digispark (pro).
- TinyPinChange_Init()
- TinyPinChange_RegisterIsr()
- TinyPinChange_EnablePin()
- TinyPinChange_DisablePin()
- TinyPinChange_GetPortEvent()
- TinyPinChange_GetCurPortSt()
- TinyPinChange_PinToMsk()
- TinyPinChange_Edge()
- TinyPinChange_RisingEdge
- TinyPinChange_FallingEdge
On the arduino MEGA (ATmega2560), as all the pins do not support "pin change interrupt", only the following pins are supported:
- 10 -> 15
- 50 -> 53
- A8 -> A15
On the arduino Lenardo, Micro and Pro Micro (ATmega32U4), as all the pins do not support "pin change interrupt", only the following pins are supported:
- 0 -> 3 (external INT0, INT1, INT2 and INT3 are used as emulated Pin Change Interrupt)
- 8 -> 11 (pin 11 is not available on the connector)
- 14 -> 17 (pin 17 is not available on the connector)
On other devices (ATmega328, ATtiny84, ATtiny85 and ATtiny167), all the pins are usable.
If you have some ideas of enhancement, please contact me by clicking on: RC Navy.