a = arduino('com3','Mega2560'); % Connect to arduinov_pin = 'A0';value = 1;dac = i2cdev(a,'0x62'); % Connect to mcp4725 using I2C protocolwrite(dac,value,'uint16') readVoltage(a, v_pin)
Right now I tell the MCP 4725 to output a certain voltage by using the following code:
I can give it a 12-bit string
My problem is that 'value' has to be an integer in the range of 0 ~ 15.
That code will NOT work on an Arduino.Matlab can NOT directly tell the MCP4725 to output a voltage. It must tell the Arduino to tell the MCP4725 to output a voltage.So, what code IS running on the Arduino?
A 12 bit value and a string are two completely different things. A 12 bit string does not make sense
Since this appears to be strictly a Matlab issue, you would be better off asking the Matlab community for help.
I will try that as well, but I disagree with you that it is strictly a Matlab issue. This forum is intended for 'interfacing with software on the computer'. Matlab is software on my computer and I am having issues with the communication/interface-aspect. Thanks for your suggestion though.
Matlab is software on my computer and I am having issues with the communication/interface-aspect.
Fine. So, post your Arduino code and we'll help you with that part of it.
So, can you help me with the matlab-arduino-interfacing problem, or do you insist that I use arduino code and delete the matlab-arduino-support-package?