mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-07-26 02:28:41 +00:00
bugfix: correct casting of return value from adc as it was always overflowing the 8 bit result
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
committed by
Daniel Esteban
parent
76a4276b5d
commit
d04e68bef8
+1
-1
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user