From f3ddfd65a21e56647264aba819c054fa2830995a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 26 Dec 2016 21:25:16 +0100 Subject: lm75 example: Add support for LM75BD (with 11-bit resolution) --- commandline/examples/lm75 | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/commandline/examples/lm75 b/commandline/examples/lm75 index 2dfd956..81fd497 100755 --- a/commandline/examples/lm75 +++ b/commandline/examples/lm75 @@ -5,16 +5,11 @@ cmd=$1 arg=$2 function read_temp { - typeset buf num + typeset buf buf=($(vusb-i2cget $addr 2 $1)) - num=$buf[1] - if (( buf[2] > 127 )); then - num="${num}.5" - fi - - echo $num + printf "%.2f\n" $(( buf[1] + (buf[2] / 256.) )) } function set_temp { -- cgit v1.2.3