Remove debug prints, correct reverse gear, tidy loop
- Comment out all Serial debugging statements and the artificial delay in Engine::update. - Change reverse gear detection from `gearIdx == 5` to `gearIdx == -1`. - Simplify the main loop in Projekt.ino by removing unnecessary braces, eliminating temporary blink variables, and calling `display.updateDirection` directly with the pin reads.
This commit is contained in:
+4
-5
@@ -30,13 +30,12 @@ void setup() {
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (gear.update()) {
|
||||
if (gear.update())
|
||||
display.updateGear(gear.getGearChar());
|
||||
}
|
||||
|
||||
leftBlink = digitalRead(TS_LEFT);
|
||||
rightBlink = digitalRead(TS_RIGHT);
|
||||
display.updateDirection(leftBlink, rightBlink);
|
||||
display.updateDirection(
|
||||
digitalRead(TS_LEFT),
|
||||
digitalRead(TS_RIGHT));
|
||||
|
||||
unsigned long now = millis();
|
||||
float dt = (now - prevUpdate) / 1000.0f;
|
||||
|
||||
Reference in New Issue
Block a user