mirror of
https://github.com/brendanhaines/ECEN5458_Project.git
synced 2024-12-26 10:57:55 -07:00
fix battery voltage gain
This commit is contained in:
parent
c5d77ac9b3
commit
5fd9bee6e1
|
@ -221,8 +221,7 @@ def update_battery_voltage(attrname=None, old=None, new=None):
|
||||||
global vbat_text
|
global vbat_text
|
||||||
vadc = get_mux_adc(BAT_MUX_CHAN)
|
vadc = get_mux_adc(BAT_MUX_CHAN)
|
||||||
# vbat = vadc * (10+1)/1
|
# vbat = vadc * (10+1)/1
|
||||||
print(vadc)
|
vbat = vadc * 12.21/1.68
|
||||||
vbat = vadc * 12.21/1.018
|
|
||||||
vbat_text.text = f"Battery Voltage: {vbat:2.1f}V"
|
vbat_text.text = f"Battery Voltage: {vbat:2.1f}V"
|
||||||
if vbat < VBAT_THRESHOLD:
|
if vbat < VBAT_THRESHOLD:
|
||||||
stop_controller()
|
stop_controller()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user