include lenght counter

This commit is contained in:
Manuel Weiser 2018-05-02 15:51:27 +02:00
parent 544332c833
commit 4542df8a62

View File

@ -48,6 +48,7 @@ bool startWind = false;
float servoPos = 0; float servoPos = 0;
bool goLeft = true; bool goLeft = true;
int leftSteps = 0; int leftSteps = 0;
float spoolLenght = 0.0;
void setup() { void setup() {
Serial.begin(115200); Serial.begin(115200);
@ -72,10 +73,12 @@ void setup() {
lcd.clear(); lcd.clear();
lcd.setCursor(0,0); lcd.setCursor(0,0);
lcd.print("Waiting..."); lcd.print("Waiting...");
//lcd.setCursor(0,1);
//lcd.print("Turn:" + String(whenJump));
lcd.setCursor(0,1); lcd.setCursor(0,1);
lcd.print("Turn:" + String(whenJump));
lcd.setCursor(8,1);
lcd.print("Wide:" + String(wideJump)); lcd.print("Wide:" + String(wideJump));
lcd.setCursor(10,1);
lcd.print(String(spoolLenght) + "m");
} }
int read_LCD_buttons() { int read_LCD_buttons() {
@ -229,26 +232,26 @@ void loop()
switch (lcd_key){ switch (lcd_key){
case btnRIGHT:{ case btnRIGHT:{
wideJump += farToJump; wideJump += farToJump;
lcd.setCursor(8,1); lcd.print(" "); lcd.setCursor(0,1); lcd.print(" ");
lcd.setCursor(8,1); lcd.print("Wide:" + String(wideJump)); lcd.setCursor(0,1); lcd.print("Wide:" + String(wideJump));
break; break;
} }
case btnLEFT:{ case btnLEFT:{
if (wideJump > 1) wideJump -= farToJump; if (wideJump > 1) wideJump -= farToJump;
lcd.setCursor(8,1); lcd.print(" "); lcd.setCursor(0,1); lcd.print(" ");
lcd.setCursor(8,1); lcd.print("Wide:" + String(wideJump)); lcd.setCursor(0,1); lcd.print("Wide:" + String(wideJump));
break; break;
} }
case btnUP:{ case btnUP:{
whenJump += 1; //whenJump += 1;
lcd.setCursor(0,1); lcd.print(" "); //lcd.setCursor(0,1); lcd.print(" ");
lcd.setCursor(0,1); lcd.print("Turn:" + String(whenJump)); //lcd.setCursor(0,1); lcd.print("Turn:" + String(whenJump));
break; break;
} }
case btnDOWN:{ case btnDOWN:{
if (whenJump > 1) whenJump -= 1; //if (whenJump > 1) whenJump -= 1;
lcd.setCursor(0,1); lcd.print(" "); //lcd.setCursor(0,1); lcd.print(" ");
lcd.setCursor(0,1); lcd.print("Turn:" + String(whenJump)); //lcd.setCursor(0,1); lcd.print("Turn:" + String(whenJump));
break; break;
} }
case btnSELECT:{ case btnSELECT:{
@ -309,6 +312,9 @@ void loop()
Serial.println(leftSteps); Serial.println(leftSteps);
revCounter = 0; revCounter = 0;
spoolLenght += 0.07;
lcd.setCursor(10,1); lcd.print(" ");
lcd.setCursor(10,1); lcd.print(String(spoolLenght) + "m");
} }
} }
} }