Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Firmware/LowLevel/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,12 @@ void loop() {
updateNeopixel();

status_message.v_battery =
(float) analogRead(PIN_ANALOG_BATTERY_VOLTAGE) * (3.3f / 4096.0f) * ((VIN_R1 + VIN_R2) / VIN_R2);
((float) analogRead(PIN_ANALOG_BATTERY_VOLTAGE) * (3.3f / 4096.0f) * ((VIN_R1 + VIN_R2) / VIN_R2)) * 0.2f + status_message.v_battery * 0.8f;
status_message.v_charge =
(float) analogRead(PIN_ANALOG_CHARGE_VOLTAGE) * (3.3f / 4096.0f) * ((VIN_R1 + VIN_R2) / VIN_R2);
((float) analogRead(PIN_ANALOG_CHARGE_VOLTAGE) * (3.3f / 4096.0f) * ((VIN_R1 + VIN_R2) / VIN_R2)) * 0.2f + status_message.v_charge * 0.8f;
#ifndef IGNORE_CHARGING_CURRENT
status_message.charging_current =
(float) analogRead(PIN_ANALOG_CHARGE_CURRENT) * (3.3f / 4096.0f) / (CURRENT_SENSE_GAIN * R_SHUNT);
((float) analogRead(PIN_ANALOG_CHARGE_CURRENT) * (3.3f / 4096.0f) / (CURRENT_SENSE_GAIN * R_SHUNT)) * 0.2f + status_message.charging_current * 0.8f;
#else
status_message.charging_current = -1.0f;
#endif
Expand Down
6 changes: 6 additions & 0 deletions Firmware/LowLevel/src/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#define PIN_ANALOG_CHARGE_VOLTAGE 26
#define PIN_ANALOG_CHARGE_CURRENT 28

#define PIN_POWER_SELECT 23

#define PIN_ENABLE_CHARGE 22

#define PIN_ESC_SHUTDOWN 20
Expand Down Expand Up @@ -58,6 +60,8 @@
#define PIN_ANALOG_CHARGE_VOLTAGE 26
#define PIN_ANALOG_CHARGE_CURRENT 28

#define PIN_POWER_SELECT 23

#define PIN_ENABLE_CHARGE 22

#define PIN_ESC_SHUTDOWN 20
Expand Down Expand Up @@ -94,6 +98,8 @@
#define PIN_ANALOG_CHARGE_VOLTAGE 26
#define PIN_ANALOG_CHARGE_CURRENT 28

#define PIN_POWER_SELECT 23

#define PIN_ENABLE_CHARGE 22

#define PIN_ESC_SHUTDOWN 20
Expand Down