master
Bryan 2021-01-01 22:34:55 -06:00
parent 5a5706fcda
commit e206eb8998
1 changed files with 2 additions and 2 deletions

View File

@ -58,8 +58,8 @@ function getBatteryVoltage() {
# @return ... charging current as string # @return ... charging current as string
function getChargeCurrent() { function getChargeCurrent() {
local currentHighByte=$(i2cget -f -y 0 0x34 0x7A) local currentHighByte=$(i2cget -y -f 0 0x34 0x7A)
local currentLowByte=$(i2cget -f -y 0 0x34 0x7B) local currentLowByte=$(i2cget -y -f 0 0x34 0x7B)
local rawCurrent=$(($(($currentHighByte << 4)) | $(($(($currentLowByte & 0x0F)))))) local rawCurrent=$(($(($currentHighByte << 4)) | $(($(($currentLowByte & 0x0F))))))
echo "($rawCurrent * 0.5)" | bc echo "($rawCurrent * 0.5)" | bc
} }