Manually access pi-top[4] Analogue ports

So i am trying to read a sensor from one of the analogue ports A0 but how do I do that.

The down side of the SDK is that it does not explain how to do this, just says that the ADC is on i2c 0x04, it only specifies how to use the ports when using a sensor in the foundation kit

sorry if it sounds dumb, never worked with i2c or spi devices

@CAProjects if you take a look here you should be able to reverse engineer it:

We use the SMbus2 library under the hood so you can just import that directly then set up an smbus device like this:

from smbus2 import SMBus
# Open i2c bus 1 
bus = SMBus(1)
a0 = bus.read_byte_data(0x04, 0x30)
a1 = bus.read_byte_data(0x04, 0x31)
2 Likes

Thanks, will look at it when I get some time to myself