Using the Analog Comparator and the ADC on the Mega2560