I would like to scan with servo motor from one to another point. While scanning I would like to read analog input. After scanning finished I would like to get min and max values of analog sensor. Analog sensor will be photocell. I have Arduino MEGA 2560. All I know is that Arduino have some memory to save data and that is all :~.
Are there any other options to save data or just simply get min and max value? Can somebody inform me how to do it? How many options are there to get these value?
Take a reading.
Compare it with your previous biggest reading.
Is it bigger? Yes, so store it.
Compare it against your previous smallest reading.
Is it smaller? Yes, so store it.
Store the position where you read it too, if you want.
"store a value" is a simple assignment in C, unless you need to store values across power-downs (which you haven't made clear), so I can't tell if you're simply over thinking this problem.
I understand your point. Sorry for stupid questions but I don't have so much experience with storing data on Arduino and I don't know how many options is there for saving data. When I browse for storing a value on Google, I get a lot of resoults about EEPROM. Are there any easiest way to store data, maybe like you suggest on first replay?