/* This file is part of the analogComp library. Please check the README file and the notes inside the analogComp.h file */ //include required libraries #include "analogComp.h" //global variables typedef void (*userFunc)(void); volatile static userFunc userFunction; uint8_t _initialized; uint8_t _interruptEnabled; uint8_t oldADCSRA; //setting and switching on the analog comparator uint8_t analogComp::setOn(uint8_t tempAIN0, uint8_t tempAIN1) { if (_initialized) { //already running return 1; } //initialize the analog comparator (AC) ACSR &= ~(1<= 0) && (tempAIN1 < NUM_ANALOG_INPUTS)) { //set the AC Multiplexed Input using an analog input pin oldADCSRA = ADCSRA; ADCSRA &= ~(1<