-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New feature: Test fake battery #94
Conversation
@dalathegreat, to ensure that someone doesn't accidentally break the code for the fake battery in the future, please consider adding a line with TEST_FAKE_BATTERY to the workflows compiling the batteries: https://github.com/dalathegreat/BYD-Battery-Emulator-For-Gen24/blob/271fc8744cedab3b54da1df2180d5f0f33c2cdb9/.github/workflows/compile-all-batteries.yml#L42 and https://github.com/dalathegreat/BYD-Battery-Emulator-For-Gen24/blob/271fc8744cedab3b54da1df2180d5f0f33c2cdb9/.github/workflows/compile-all-combinations.yml#L45 |
Software/Software.ino
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me it seems a bit strange that the led states are defined twice: once in Software.ino, and once in the battery file. Perhaps not blocking for this PR, but for the future it may be useful to define these states once in a separate header file, which can then be included by both Software.ino and the battery file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What
This pull request adds a new feature, which lets you test your system with a fake battery!
Why
This new test mode can be very useful when testing a new inverter, or testing the inverter before the battery setup is complete, or doing isolation testing for troubleshooting. This means you no longer have to have a working battery on the CAN bus. The user "f1racr" on the Discord had great progress with this test mode!
How
There is now a new define,
#define TEST_FAKE_BATTERY
that can be enabled in theUSER_SETTINGS.h
file. When enabled, the values set inTEST-FAKE-BATTERY.cpp
will be sent towards your inverter of choice. While in this test mode, the LED on the board will cycle thru all RGB values, letting you know you are in a special mode.