See attached picture:
The stepper motor sets the potentiometer to the midpoint (zero) position. This code works fine. The Pot will therefore always start off from the midpoint (adc = 128 from +5V input).
In the pic. the whole lot is contained by the caliper and can only move in one direction (towards the stepper). In real life it will be able to move both left and right from the midpoint.
I will then get the ADC shift from 128 (midpoint) and calculate the mm movement.
Suggestions and comments appreciated.
EDIT:
This is part of the drive-over alignmnet project.
The stepper motor sets the potentiometer to the midpoint (zero) position. This code works fine. The Pot will therefore always start off from the midpoint (adc = 128 from +5V input).
Code:
Pot
+5V-----/\/\/\/\/\/\-------0V
^
| wiper
adc input ------
I will then get the ADC shift from 128 (midpoint) and calculate the mm movement.
Suggestions and comments appreciated.
EDIT:
This is part of the drive-over alignmnet project.
Attachments
-
241.1 KB Views: 62
Last edited: