At line (2) in the following code block, we use the busio import to create an I2C interface with Circuit Python/Blika. The board.SLC and board.SDA parameters indicate we are using the dedicated I2C channel (alternative functions of GPIO 2 and 3) on the Raspberry Pi:
# Create the I2C bus & ADS object.
i2c = busio.I2C(board.SCL, board.SDA) # (2)
ads = ADS.ADS1115(i2c)
Next, we create an instance of ADS.ADS1115 using the pre-configured I2C interface and assign it to the ads variable. From this point forward in the code, when we interact with our ADS1115 module, we will use this instance.
Next, let's consider the global variables.