diff --git a/Software/Software.ino b/Software/Software.ino index 48ae8b4d..eb5e3bd8 100644 --- a/Software/Software.ino +++ b/Software/Software.ino @@ -79,6 +79,7 @@ uint16_t cell_min_voltage = 3700; // Stores the minimum cell voltage value in t #define YELLOW 1 #define RED 2 #define BLUE 3 +#define TEST_ALL_COLORS 10 Adafruit_NeoPixel pixels(1, WS2812_PIN, NEO_GRB + NEO_KHZ800); static uint8_t brightness = 0; @@ -451,6 +452,9 @@ void handle_LED_state() { case RED: pixels.setPixelColor(0, pixels.Color(150, 0, 0)); // Red LED full brightness break; + case TEST_ALL_COLORS: + pixels.setPixelColor(0, pixels.Color(brightness, abs((100 - brightness)), abs((50 - brightness)))); // RGB + break; default: break; } diff --git a/Software/USER_SETTINGS.h b/Software/USER_SETTINGS.h index c05068c6..a578c37e 100644 --- a/Software/USER_SETTINGS.h +++ b/Software/USER_SETTINGS.h @@ -13,7 +13,7 @@ //#define NISSAN_LEAF_BATTERY //#define RENAULT_ZOE_BATTERY //#define TESLA_MODEL_3_BATTERY -//#define TEST_FAKE_BATTERY +#define TEST_FAKE_BATTERY /* Select inverter communication protocol. See Wiki for which to use with your inverter: https://github.com/dalathegreat/BYD-Battery-Emulator-For-Gen24/wiki */ //#define BYD_CAN //Enable this line to emulate a "BYD Battery-Box Premium HVS" over CAN Bus diff --git a/Software/src/battery/TEST-FAKE-BATTERY.cpp b/Software/src/battery/TEST-FAKE-BATTERY.cpp index 7353d8d4..d825bd34 100644 --- a/Software/src/battery/TEST-FAKE-BATTERY.cpp +++ b/Software/src/battery/TEST-FAKE-BATTERY.cpp @@ -19,7 +19,7 @@ void print_units(char* header, int value, char* units) { void update_values_test_battery() { /* This function puts fake values onto the parameters sent towards the inverter */ bms_status = ACTIVE; //Always be in Active mode - LEDcolor = GREEN; + LEDcolor = TEST_ALL_COLORS; // Cycle the LED thru all available colors SOC = 5000; // 50.00% diff --git a/Software/src/battery/TEST-FAKE-BATTERY.h b/Software/src/battery/TEST-FAKE-BATTERY.h index 20d5bd2a..6661f9fc 100644 --- a/Software/src/battery/TEST-FAKE-BATTERY.h +++ b/Software/src/battery/TEST-FAKE-BATTERY.h @@ -38,6 +38,7 @@ extern uint8_t LEDcolor; //Enum, 0-2 #define YELLOW 1 #define RED 2 #define BLUE 3 +#define TEST_ALL_COLORS 10 void update_values_test_battery(); void receive_can_test_battery(CAN_frame_t rx_frame);