Professional Documents
Culture Documents
X and Z Axis
X and Z Axis
X and Z Axis
void setup() {
lcd.begin(20, 4); // My display has 20 Columns, 4 Rows.
}
long oldPosition = -999;
void loop() {
const float Wv = (.1 * PI) / 600; // Math formula for .37" diameter pulley
//and 600 pulse/revolution encoder.
lcd.setCursor(2, 3);
lcd.print(Wv * newPosition, 3);//Math formula * Encoder reading ,3 decimals
lcd.setCursor(9, 1);
lcd.print("|");// Graphic symbol to separate imperial and metric display.
lcd.setCursor(9, 3);
lcd.print("|");
lcd.setCursor(11, 3);
lcd.print(Wv * newPosition * 25.4, 2); // Formula to convert imperial
// and metric, 2 decimals.
}
// ______________________________________________________________________
// X Axis Sketch
void setup() {
lcd.begin(20,4);// 20 Columns, 4 Rows.
}
long oldPosition= -999;
void loop() {
const float Wv =(.1 * PI)/600; // Formula to set the linear distance travelled in
one pulse.