/** * @file ledControlls.cpp * @author Lyubomir Penev (me@lpenev.com) * @brief This file contains all the functions which control the LEDs used to indicate the current max volume * @version 0.1 * @date 2025-10-31 * * @copyright Copyright (c) 2025 * */ #include #include #include /** * @brief This function sets all the LEDs to a default(LOW) state * */ void resetLeds() { digitalWrite(LED_HIGH, LOW); digitalWrite(LED_MED, LOW); digitalWrite(LED_LOW, LOW); } /** * @brief This function turns on the correct LED depending on the current max(staff) volume * * @param volume The current max(staff) volume */ void updateLeds(int volume) { switch (volume) { case 64: resetLeds(); digitalWrite(LED_HIGH, HIGH); break; case 48: resetLeds(); digitalWrite(LED_MED, HIGH); break; case 32: resetLeds(); digitalWrite(LED_LOW, HIGH); break; case 16: resetLeds(); digitalWrite(LED_HIGH, HIGH); digitalWrite(LED_MED, HIGH); digitalWrite(LED_LOW, HIGH); break; } }