图片缩略图

遗留MATLAB和Simulink支金宝app持Arduino金宝app

版本1.14.0.0(170 KB)由 詹皮罗坎帕酒店
MATLAB类和Simulink模金宝app块用于与Arduino微控制器板通信

210K下载

更新2016年4月19日

查看许可协议

编者按:受欢迎的文件201220132014201520162017201820192020

注意:此解决方案(以前称为“Arduino IO包”)不再受支持。建议您使用MathWorks开发和支持的Arduino支持包:金宝app

- Arduino金宝app硬件MATLAB支持包:读取、写入和分析来自Arduino传感器的数据
//www.tatmou.com/hardware-金宝appsupport/arduino-matlab.html

Si金宝appmuli金宝appnk Support Package for Arduino Hardware:开发独立运行在Arduino上的算法
//www.tatmou.com/hardware-金宝appsupport/arduino-金宝appsimulink.html

只有在以下情况之一为真时才使用此金宝app遗留支持:
-您使用的是MATLAB R2013b或更早版本(但不早于R2011a)。
-您需要Simulin金宝appk块,使您能够交互流输入和输出从您的Arduino
-您需要功能或块,使您能够交互读取或重置编码器
-您使用的是不支持的Arduino克金宝app隆,无法与官方包(例如ChipKit32)工作

示例用法:
------------------

%——连接到板子
a=arduino(“COM9”)

%--指定pin模式
a.pinMode(4、“输入”);
a.pinMode(13,“输出”);

%——数字i / o
a.digitalRead(4) %读取引脚4
a.digitalWrite(13,0) % write 0 to引脚13

%--模拟输入/输出
a、 模拟读取(5)%读取模拟引脚5
a、 模拟写入(9155)%155写入模拟引脚9

%——串行端口
A.serial %获取串口
a.flush;%刷新PC的输入缓冲区
a、 往返(42)%42发送到arduino并返回

%,伺服系统
a、 伺服连接(9);%将伺服连接到销#9上
a.servoWrite (9100);%旋转伺服销#9到100度
val = a.servoRead (9);%读取销9上的伺服角度
a、 伺服分离(9);%从销9分离伺服

%——编码器
在引脚3(引脚A)和2(引脚B)上附加编码器#0
. encoderread(0) %读取位置
a、 编码器重置(0)%reset编码器0
a、 编码器状态;%获取所有三个编码器的状态
a、 encoderDebounce(0,12)%1.2ms)将去盎司延迟设置为12
a.encoderDetach (0);%分离编码器#0

%——adfruit电机屏蔽(带AFMotor库)
a.motorRun(4, 'forward') %向前运行电机
a、 步进步进(1,'向前','双',100);%移动步进电机

%--闭门会议
删除()

与此软件包相关的一些幻灯片和示例可在此处找到:
//www.tatmou.com/matlabcentral/fileexchange/27843

最后,有关使用和疑难解答的更多详细信息,请参阅本次提交的readme.txt文件。

引用作为

詹坎(2021)。遗留MATLAB和Simulink支金宝app持Arduino金宝app(//www.tatmou.com/matlabcentral/fileexchange/32374-legacy-matlab-and-金宝appsimu金宝applink-support-for-arduino), MATLAB中央文件交换。检索