Tuesday, November 18, 2014
The Arduino code:
height = map(adc, 171, 512, 12, 0);
In Excel becomes:
= (adc-in_min)*(out_max-out_min) / (in_max-in_min) + out_min
The following emulates a voltage divider that converts a fluid level of a container to gallons. It uses a reverse map as decreasing resistance of the sensor means increasing depth.
Posted by Steve Spence at 5:20 PM