ArduinoGeneral

HOW TO USE RASPBERRY PI AND THE MCP3424 18-BIT ADC-4 CHANNEL?

userHead Account cancelled 2018-05-21 00:30:25 1730 Views0 Replies
Hi everyone,

I've been trying to get the ADC to work with the Pi 3 since I got it with no luck.

The library that's on DFRobot is extremely outdated (4 years old) and only supports kernel version 3.11 and below.

Can someone PLEASE help me get started with this thing?

I've connected Ch+1 to the signal(LDR), SDA and SCL to their corresponding pins on the Pi and the power, as well.

I ran the following code:
---------------------
import smbus
address=0x20
bus = smbus.SMBus(1)

result=bus.read_byte_data(address,0x09)
print result
---------------------

And the result is 255. No matter the light intensity on the LDR it will still show 255

I then tried connecting the Ch1- to ground instead of leaving it unconnected like in the first case and the result is 4. It doesn't change with light intensity, as well.

Can someone please share with me the proper way to use it?