MATLAB AND ARDUINO SERIAL COMMUNICATION

版本 1.0.0.0 (6.6 KB) 作者: VALARMATHY K
Serial communication between matlab and arduino by matlab GUI Push button
481.0 次下载
更新时间 2017/10/13

查看许可证

By changing the COM port in the code you can connect after clicking connect wait for few second and then it will works
ARDUINO CODE:
const int LED=13;
int NewValue;
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);
}
void loop()
{
if(Serial.available()>0)
{
NewValue=Serial.read();
if (NewValue == 100)
{
digitalWrite(LED, HIGH);

}
if(NewValue == 101)
{
digitalWrite(LED, LOW);
}
}
}

引用格式

VALARMATHY K (2024). MATLAB AND ARDUINO SERIAL COMMUNICATION (https://www.mathworks.com/matlabcentral/fileexchange/64709-matlab-and-arduino-serial-communication), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2013a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

SERIAL_COMMUNICATION/

版本 已发布 发行说明
1.0.0.0

.
ARDUINO CODE: