Is it possible for an Arduino board to save a variable to itself non-volitile? Is there a portion of the onboard flash that can be written to?
I have four track sensors reading reflectors on a black rubber track. I had used QRE1113 sensors but they didn’t have the range I needed for variance in the track (they had to be placed within 1/32 to 1/16 inch from the track, and as the track curved the black reflectance level went into the reflector level). Even with these production sensors, though, I had too much of a variance between sensors to use one flat variable for all the sensors.
After having a sensor damaged and “seeing” stops on the track where there were none, I built my own sensors. They have much better range (up to 1/2") and are much more tolarant of variance in distance. Unfortunately, there is still a large difference between each sensor.
The device will likely be produced on a small scale and sent to other sites under varying conditions, so I would like to have a calibration feature. What I want to do is be able to scan the track, compare high and low readings for each sensor and determine a proper threshold value for each sensor that can be saved in some way in case the unit needs to be powered down. The calibration variables would only be saved when the calibration mode is selected (button or other on board control), but read each time the unit powers up (loads the program).
The board I intend to use is the Wild Thumper that uses a ATMega168.
Another option I may be able to exploit (if I figure out how) is if a Wixel board can save data. I may use a pair for the remote control and additional inputs, but that is a way down the road (I’d have to learn the ins and outs of that board, and I don’t ahve time at this point).