wrap printing on LCD
This commit is contained in:
		| @@ -60,14 +60,23 @@ BasicStepperDriver stepper(STEPPER_STEPS, PIN_STEPPER_DIR, PIN_STEPPER_STEP); | |||||||
| enum State { STATE_MENU, STATE_JOG, STATE_RUN }; | enum State { STATE_MENU, STATE_JOG, STATE_RUN }; | ||||||
| State state = STATE_MENU; | 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() { | result enter_jog() { | ||||||
|   lcd.setCursor(0, 0); |  | ||||||
|   lcd.print("Jogging...      "); |  | ||||||
|   lcd.setCursor(0, 1); |  | ||||||
|   lcd.print("[sel] to exit   "); |  | ||||||
|   Serial.println("enter_jog()"); |   Serial.println("enter_jog()"); | ||||||
|  |   lcd_print(0, "Jogging..."); | ||||||
|  |   lcd_print(1, "[sel] to exit"); | ||||||
|   state = STATE_JOG; |   state = STATE_JOG; | ||||||
|   return proceed; |   return proceed; | ||||||
| } | } | ||||||
| @@ -167,10 +176,8 @@ void setup() { | |||||||
|   stepper.setSpeedProfile(stepper.LINEAR_SPEED, STEPPER_ACCEL, STEPPER_DECEL); |   stepper.setSpeedProfile(stepper.LINEAR_SPEED, STEPPER_ACCEL, STEPPER_DECEL); | ||||||
|  |  | ||||||
|   lcd.begin(16,2); |   lcd.begin(16,2); | ||||||
|   lcd.setCursor(0, 0); |   lcd_print(0, "PhotoStepper"); | ||||||
|   lcd.print("PhotoStepper"); |   lcd_print(1, "schatenseite.de"); | ||||||
|   lcd.setCursor(0, 1); |  | ||||||
|   lcd.print("schatenseite.de"); |  | ||||||
|   delay(2000); |   delay(2000); | ||||||
|   nav.doOutput(); |   nav.doOutput(); | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user