Rename Projekt.ino to Projekt_Arduino.ino
Rename Projekt.ino to Projekt_Arduino.ino - Rename the main sketch file and adjust references accordingly. - Clean up Config.h spacing and delete unused turn‑signal constants. - Remove direction‑related LCD character data and its update logic. - Introduce Display::startOrEnd to control LCD power on/off. - Simplify display initialization and eliminate the old delay in the loop. - Add serial debug output for the car enable state.
This commit is contained in:
+10
-28
@@ -2,22 +2,23 @@
|
||||
|
||||
void Display::begin(int cols, int rows) {
|
||||
_lcd.begin(cols, rows);
|
||||
|
||||
_lcd.createChar(CHAR_LEFT, _leftChar);
|
||||
_lcd.createChar(CHAR_RIGHT, _rightChar);
|
||||
_lcd.createChar(CHAR_LEFT_BLINK, _leftCharBlink);
|
||||
_lcd.createChar(CHAR_RIGHT_BLINK, _rightCharBlink);
|
||||
_lcd.noDisplay();
|
||||
|
||||
_lcd.setCursor(0, 0);
|
||||
_lcd.print("km/h: 000 | ");
|
||||
_lcd.write((uint8_t)CHAR_LEFT);
|
||||
_lcd.print(" ");
|
||||
_lcd.write((uint8_t)CHAR_RIGHT);
|
||||
|
||||
_lcd.setCursor(0, 1);
|
||||
_lcd.print("rpm: 0000 | G:0");
|
||||
}
|
||||
|
||||
void Display::startOrEnd(bool enable) {
|
||||
if (enable) {
|
||||
delay(3000);
|
||||
_lcd.display();
|
||||
} else {
|
||||
_lcd.noDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
void Display::updateSpeed(int kmh) {
|
||||
if (kmh < 0) kmh = 0;
|
||||
if (kmh > 999) kmh = 999;
|
||||
@@ -44,22 +45,3 @@ void Display::updateGear(char gearChar) {
|
||||
_lcd.print(gearChar);
|
||||
_lcd.print(' ');
|
||||
}
|
||||
|
||||
// void Display::updateDirection(bool leftOn, bool rightOn) {
|
||||
// if (leftOn && rightOn) {
|
||||
// _lcd.setCursor(12, 0);
|
||||
// _lcd.write((uint8_t)CHAR_LEFT);
|
||||
// _lcd.print(' ');
|
||||
// _lcd.write((uint8_t)CHAR_RIGHT);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// unsigned long now = millis();
|
||||
// bool leftBlink = leftOn && ((now / 1000UL) % 2 == 0);
|
||||
// bool rightBlink = rightOn && ((now / 1000UL) % 2 == 0);
|
||||
|
||||
// _lcd.setCursor(12, 0);
|
||||
// _lcd.write((uint8_t)(leftBlink ? CHAR_LEFT_BLINK : CHAR_LEFT));
|
||||
// _lcd.print(' ');
|
||||
// _lcd.write((uint8_t)(rightBlink ? CHAR_RIGHT_BLINK : CHAR_RIGHT));
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user