Step 11: How the Analog Comparator works
Optionally, the comparator can trigger an interrupt, exclusive to the Analog Comparator. The associated vector is ANALOG_COMP_vect.
We can also set the the interrupt to be launched on a rising edge, falling edge or on a toggle of the state.
The Analog Comparator is just what we need for the triggering connecting out input signal to pin 6, now what is left is a threshold level on pin 7.