Hi,
I've had a read around this subject and want to confirm that my understanding is correct, I am using an Arduino board that has an ATMega 1280 chip.
The ATMega datasheet seems to indicate that the Analog Comparator can be set up to trigger an interrupt when the voltage on the A1 pin exceeds the voltage on the A0 pin. So presumably if I connect a potentiometer to A0 I can set the trigger voltage to a suitable threshold (I'm looking at something that swings from around 2.5v to 1v)?
Is a pot. the best way of setting the threshold voltage or is there a better way?
I always struggle converting what the datasheet says into practical ARDUINO code. Any hints as to what the actual codes looks like would be greatly appreciated.
I've had a read around this subject and want to confirm that my understanding is correct, I am using an Arduino board that has an ATMega 1280 chip.
The ATMega datasheet seems to indicate that the Analog Comparator can be set up to trigger an interrupt when the voltage on the A1 pin exceeds the voltage on the A0 pin. So presumably if I connect a potentiometer to A0 I can set the trigger voltage to a suitable threshold (I'm looking at something that swings from around 2.5v to 1v)?
Is a pot. the best way of setting the threshold voltage or is there a better way?
I always struggle converting what the datasheet says into practical ARDUINO code. Any hints as to what the actual codes looks like would be greatly appreciated.