mcp3008: fix bitshift bug

This commit is contained in:
soypat
2021-11-13 16:09:50 -03:00
committed by Ron Evans
parent 334ed57373
commit 520234e9f8
+1 -1
View File
@@ -83,7 +83,7 @@ func (p ADCPin) Get() uint16 {
p.d.bus.Tx(p.d.tx, p.d.rx)
// scale result to 16bit value like other ADCs
result := uint16((p.d.rx[1]&0x3))<<8 + uint16(p.d.rx[2])<<6
result := uint16((p.d.rx[1]&0x3))<<(8+6) + uint16(p.d.rx[2])<<6
p.d.cs.High()
return result