generated from TDD-Templates/cmake_cpputest_template
Removed `updateLEDs()` function
This will help reduce the used code/space.
This commit is contained in:
parent
508522a2b7
commit
2db3af1928
|
@ -253,20 +253,6 @@ void loop() {
|
||||||
updateDisplay();
|
updateDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to update the LED ring based on heading direction
|
|
||||||
void updateLEDs(int heading) {
|
|
||||||
if (abs(heading - prevHeading) >= 10) { // Only update if the heading changes by 10 degrees or more
|
|
||||||
prevHeading = heading; // Save the current heading as the previous heading
|
|
||||||
int ledIndex = map(heading, 0, 360, 0, NUM_LEDS - 1); // Map the heading to an LED index (0-23)
|
|
||||||
|
|
||||||
// Update the LEDs in the ring
|
|
||||||
for (int i = 0; i < NUM_LEDS; i++) {
|
|
||||||
leds[i] = (i == ledIndex) ? CRGB(255, 0, 0) : CRGB::Black; // Turn on the correct LED for the heading
|
|
||||||
}
|
|
||||||
FastLED.show(); // Display the updated LED colors
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Updates the distance part of the display
|
// Updates the distance part of the display
|
||||||
void TFT_UpdateDistance(uint16_t meters) {
|
void TFT_UpdateDistance(uint16_t meters) {
|
||||||
//Serial.println("TFT_UpdateDistance()");
|
//Serial.println("TFT_UpdateDistance()");
|
||||||
|
|
Loading…
Reference in New Issue