MATLAB AND ARDUINO SERIAL COMMUNICATION

Serial communication between matlab and arduino by matlab GUI Push button
481 Downloads
Aktualisiert 13. Okt 2017

Lizenz anzeigen

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);
}
}
}

Zitieren als

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

Kompatibilität der MATLAB-Version
Erstellt mit R2013a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Startup and Shutdown finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

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

Start Hunting!

SERIAL_COMMUNICATION/

Version Veröffentlicht Versionshinweise
1.0.0.0

.
ARDUINO CODE: