We are using the smbus2 library in Python to read data coming originally from a TMSC1108-Q1 current sensor (analog) which is sent through an ADS7828 ADC and communicated to a Raspberry Pi via I2C protocol. We defined an array of length 8 with the value at each index representing a different channel: ads7828_commands = [0x84, 0xc4, 0x94, 0xd4, 0xa4, 0xe4, 0xb4, 0xf4]. We then create a function that takes one argument, an integer between 0 and 7 inclusive named "input”, and within the function we have "bus.write_byte(0x4b, ads7828_commands[input])" followed by "return bus.read_byte(0x4b)." Note that 0x4b is the address of this ADC.
We have two main areas that we would like to resolve and gain better clarity on: