We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 334ed57 commit 520234eCopy full SHA for 520234e
mcp3008/mcp3008.go
@@ -83,7 +83,7 @@ func (p ADCPin) Get() uint16 {
83
p.d.bus.Tx(p.d.tx, p.d.rx)
84
85
// scale result to 16bit value like other ADCs
86
- 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
87
p.d.cs.High()
88
89
return result
0 commit comments