Measuring High's and Low's of an Analog input?

Hello, I am wondering.... I have an input that is fluctuating, on and off, almost like the blink code. That signal is connected to an analog input, i was wondering, how i can measure and print the highest of the voltages, and the lowest of the voltage connected to the analog input. For instance, in the serial port it would print: Highest measured= 267; Lowest measured = 3;


Over some period of time?

Or print a new value whenever a new low arrived, or a new high?

You're reading values now. Just add a couple of variables, maxVal and minVal. Compare the reading with minVal and maxVal. Replace maxVal if the new reading is higher. Replace minVal with the new reading if it's lower.