Using Matlab to read from a PI-SPI-8AI+ board using SPI
4 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a PI-SPI-8AI+ board using a 12 bit A/D converter connected to a Raspberry Pi with some pressure sensors connected to it that I'm trying to read data from using Simulink and Matlab.
In Python I've been using the widgetlords library which makes this an easy task but in Matlab and Simulink I haven't been able to do it yet.
I've been looking at this example (the one under "Read voltage"): https://www.mathworks.com/help/supportp ... g-spi.html
This example does everything I want to do with the PI-SPI-8AI+ but I fail to understand what I need to update to make it work with this board, which I believe is using a MCP3208 chip instead of the MCP3008 in the example. So 12 bits instead of 10.
In the example they use [1, bin2dec('10000000'), 0] which I think I need to extend to 12 bits but I'm not sure how to modify correctly.
Does anyone know if there is an example that could help me or can someone please tell me how to update the code example?
Any help would be much appreciated.
Thanks in advance!
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Support Package for Raspberry Pi Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!