The DAC brick contains a MCP4728 12bit digital to analogue converter attached to an MSOP to DIL adapter board, which provides an I2C port to interface with the ARD brick
and four analogue outputs (bottom) - one for each channel.
| | |
#Example Python code to test a DAC 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 the ARD and the PC
dac(port,0,1000) #Set dac0 equal to 1V (1000mV)
dac(port,1,2000) #Set dac1 equal to 2V (2000mV)
dac(port,2,3000) #Set dac2 equal to 3V (3000mV)
dac(port,3,4000) #Set dac3 equal to 4V (4000mV)
port.close()