mirror of
https://github.com/dexterbg/Twizy-Virtual-BMS.git
synced 2024-11-08 12:25:42 +00:00
- Template code update
This commit is contained in:
parent
35cd9fc142
commit
3432e8cc1b
1 changed files with 13 additions and 10 deletions
|
@ -52,6 +52,19 @@ void bmsEnterState(TwizyState currentState, TwizyState newState) {
|
|||
// Add your code here
|
||||
//
|
||||
|
||||
if (currentState == Init && newState == Ready) {
|
||||
// Init OP data:
|
||||
twizy.setPowerLimits(18000, 8000);
|
||||
twizy.setChargeCurrent(35);
|
||||
twizy.setSOH(100);
|
||||
twizy.setSOC(90);
|
||||
twizy.setTemperature(20, 20, true);
|
||||
twizy.setVoltage(50.0, true);
|
||||
twizy.setCurrent(0.0);
|
||||
twizy.setError(TWIZY_OK);
|
||||
Serial.println(F("bmsEnterState Init->Ready: OP data initialized"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -123,16 +136,6 @@ void setup() {
|
|||
twizy.attachProcessCanMsg(bmsProcessCanMsg);
|
||||
twizy.attachTicker(bmsTicker);
|
||||
|
||||
// Init data:
|
||||
twizy.setPowerLimits(18000, 8000);
|
||||
twizy.setChargeCurrent(35);
|
||||
twizy.setSOH(100);
|
||||
twizy.setSOC(90);
|
||||
twizy.setTemperature(20, 20, true);
|
||||
twizy.setVoltage(50.0, true);
|
||||
twizy.setCurrent(0.0);
|
||||
twizy.setError(TWIZY_OK);
|
||||
|
||||
//
|
||||
// Add your code here
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue