|
No, it is scaled to sensor_counts / degree. Sensor_counts are the values from the analog input. These (and loops) are dimensionless.
If the machine is turning at one degree per sample time, then the analog input will read 127+53 each time it is sampled.
If it is moving slower (I hope it is, that's FAST!), then the number will be smaller. This means that each time thru the loop, the new motion will be less than 1 degree, so you have to accumulate in smaller units. You can accumulate these "sensor_counts" until there is enough to total at least one degree. Then you increment the degree counter, and subtract 53 from the sensor_counts accumulator.
The logic for values less than 127 (turning the other way), is left as an exercise for the reader(s).
__________________
Don Reid
|