Go Down

Topic: Analog Comparator Interrupt (Read 24419 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

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131