readRegister function undefined when used in GUIDE
显示 更早的评论
Hi All,
I'm a hobbyist attempting to create a basic gui that will sample data from an I2C based current sensor that is attached to my raspberry pi. I have written and successfully tested a class that correctly samples this data when run via a standard Matlab Script. However, when I attempt to code this into a gui, I get the following error message when I try to call the readRegister function:
Undefined function 'readRegister' for input arguments of type 'double'.
From doing research, I believe that matlab somehow cannot locate the readRegister function when called from the gui. This confuses me since the function easily runs if I simply call it from the command line, for example this works outside of the gui:
config_values = readRegister(sensor.i2cLink,register_address,'uint8',2);
where sensor.i2cLink and register_address are specifically defined (and verified to exist when debugging).
Does anyone know of a work around to this?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Run on Target Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!