wrap printing on LCD

This commit is contained in:
Ronald Schaten 2022-02-01 18:31:32 +01:00
parent 029dfb5e34
commit 9b76d6766a

View File

@ -60,14 +60,23 @@ BasicStepperDriver stepper(STEPPER_STEPS, PIN_STEPPER_DIR, PIN_STEPPER_STEP);
enum State { STATE_MENU, STATE_JOG, STATE_RUN };
State state = STATE_MENU;
void lcd_print(int line, String string) {
Serial.print("lcd_print(");
Serial.print(line);
Serial.print(", \"");
Serial.print(string);
Serial.println("\")");
lcd.setCursor(0, line);
lcd.print(string);
for (int i = string.length(); i<16; i++) lcd.print(' ');
}
// ===
result enter_jog() {
lcd.setCursor(0, 0);
lcd.print("Jogging... ");
lcd.setCursor(0, 1);
lcd.print("[sel] to exit ");
Serial.println("enter_jog()");
lcd_print(0, "Jogging...");
lcd_print(1, "[sel] to exit");
state = STATE_JOG;
return proceed;
}
@ -167,10 +176,8 @@ void setup() {
stepper.setSpeedProfile(stepper.LINEAR_SPEED, STEPPER_ACCEL, STEPPER_DECEL);
lcd.begin(16,2);
lcd.setCursor(0, 0);
lcd.print("PhotoStepper");
lcd.setCursor(0, 1);
lcd.print("schatenseite.de");
lcd_print(0, "PhotoStepper");
lcd_print(1, "schatenseite.de");
delay(2000);
nav.doOutput();
}