xpertsavenue / WiringOP-Zero

WiringPi / WiringOP libary for the Orange Pi Zero with 26 pin GPIO header
GNU Lesser General Public License v3.0
173 stars 82 forks source link

Reading wrong value from ADC (wrong byte) #20

Open edwin-oetelaar opened 6 years ago

edwin-oetelaar commented 6 years ago

https://github.com/xpertsavenue/WiringOP-Zero/blob/8830c868ed9b3135efb98824bf1fb22a38d31320/wiringPi/mcp3422.c#L81

value = ((buffer [0] & 0x0F) << 8) | buffer [1] ; / use the correct bytes please /