Go Down

Topic: Analog Comparator Interrupt (Read 12916 times) previous topic - next topic


afremont - many thanks, that's excellent.


Hello guys!

I have trouble in my head :-D... I'm trying to measure pulse width at treshold on Arduino MEGA2560, so I've decided to use the analog comparator.

I want to have:
signal connected to AIN0
treshold connected to AIN1

easy code:
void setup()

ACSR = B00011011; // comparator interrupt enabled and tripped on falling edge.

void loop()

Serial.println("Interrupt Executed!");

Which pin am I supposed to use? I've read the datasheet and there is no connection of AIN0 to any pin, where I can connect my signal :-/

Any advices??

Thank you!

Go Up