From e206eb8998aac1a4a5ddcdc5302e5bcd03c9db76 Mon Sep 17 00:00:00 2001 From: Bryan Date: Fri, 1 Jan 2021 22:34:55 -0600 Subject: [PATCH] bugfix ? --- chip-battery.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chip-battery.sh b/chip-battery.sh index 06b8e75..30ffd74 100755 --- a/chip-battery.sh +++ b/chip-battery.sh @@ -58,8 +58,8 @@ function getBatteryVoltage() { # @return ... charging current as string function getChargeCurrent() { - local currentHighByte=$(i2cget -f -y 0 0x34 0x7A) - local currentLowByte=$(i2cget -f -y 0 0x34 0x7B) + local currentHighByte=$(i2cget -y -f 0 0x34 0x7A) + local currentLowByte=$(i2cget -y -f 0 0x34 0x7B) local rawCurrent=$(($(($currentHighByte << 4)) | $(($(($currentLowByte & 0x0F)))))) echo "($rawCurrent * 0.5)" | bc }