Skip to content

Commit

Permalink
bugfix: correct casting of return value from adc as it was always ove…
Browse files Browse the repository at this point in the history
…rflowing the 8 bit result

Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram authored and conejoninja committed Oct 29, 2024
1 parent 76a4276 commit d04e68b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pcf8591/pcf8591.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (p ADCPin) Get() uint16 {
p.d.bus.Tx(p.d.Address, tx, rx)

// scale result to 16bit value like other ADCs
return uint16(rx[1] << 8)
return uint16(rx[1]) << 8
}

// Configure here just for interface compatibility.
Expand Down

0 comments on commit d04e68b

Please sign in to comment.