Skip to content

Commit d04e68b

Browse files
deadprogramconejoninja
authored andcommitted
bugfix: correct casting of return value from adc as it was always overflowing the 8 bit result
Signed-off-by: deadprogram <[email protected]>
1 parent 76a4276 commit d04e68b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: pcf8591/pcf8591.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (p ADCPin) Get() uint16 {
7676
p.d.bus.Tx(p.d.Address, tx, rx)
7777

7878
// scale result to 16bit value like other ADCs
79-
return uint16(rx[1] << 8)
79+
return uint16(rx[1]) << 8
8080
}
8181

8282
// Configure here just for interface compatibility.

0 commit comments

Comments
 (0)