I am having an issue when trying to use the 8-Channel 12-Bit ADC for Raspberry Pi. I have followed the setup code and run the code as shown in 8-Channel 12-Bit ADC for Raspberry Pi (STM32F030) - Seeed Wiki. The code I’m running is exactly the same apart from line 4 where ‘ADC_DEFAULT_IIC_ADDR = 0X04’ is changed to ‘ADC_DEFAULT_IIC_ADDR = 0X08’ as this is the address for i2c on the rasberry pi.
I am currently only getting zeros on all output, where i would be expecting a floating value on and ADC which is not connected to anything.
Any advice on how to fix?
HI,
I was able to get it working by using the code in the link below.
i changed line 57:
def init(self, address = 0x04): to def init(self, address = 0x08): as this is the address of my i2c on the unit.
you can check the i2c address by opening command prompt and typing ’ i2cdetect -y 1’
Hey Alex,
Did you ever actually get the Grove Hat to spit out usable readings? For me it’s all zeros, even though I did change the code to fit the corresponing i2c address… Others seem to have the exact same problem, so I’m wondering if you’re the exception.
I was able to get out usable readings using the method I mentioned above, think the code you need to use depends on the processor on the grove hat you bought. The one I had the MM32 which was the new version at the time hence why the method above worked. However I’m unsure if it has been changed again since. I did contact seeedstudio technical support but had no response from them.
If i am able to find the full code i used i will post it on here.
Hi everyone,
I am new on this forum and I am having the same type of problem. I am using alternatively “Grove Base Hat” and “8-channel 12-bits ADC” with a reTerminal.
The “8-channel-hat” return values that seems ok, using a 0-5V pressure sensor and manometer to confirm the pressure evolution. The “Grove base hat” return only 0. Using the command ’ i2cdetect -y 1’ in a shell help me a lot to understand what is the adress of the i2c.
0x04 for the “8-channel-hat” and 0x08 for the “Grove base hat”.
Changing the adresse from 0x04 to 0x08 doesn’t change anything for me. For information, digital input and output work well on the “Grove base hat”.
I am looking for a solution and I will let you know if I find it.