The ADC brick contains 16-bit analogue to digital converter with a PGA (ADS1115). The ADC brick has two digital I2C ports
(left and right) to comunicate with the I2Bricks and one analogue (4 channel) port (bottom)
| | |
#Example Python code to test an ADC brick connected to an ARD brick
from I2Brick import *
port = I2Brick('COM4') #Windows: Initialize the serial communication with I2Bricks
#port = I2Brick('/dev/ttyUSB0') #Linux: Initialize the serial communication with I2Bricks
print(ard(port)) #test the communication between ARD and PC
print()
dac(port, 0, 4000)
for i in range(0, 4):
voltage = (adc(port, i))
print("Channel %d = %.2f milivolts" %(i ,voltage))
port.close()