MATLAB AND ARDUINO SERIAL COMMUNICATION
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);
}
}
}
Citation pour cette source
VALARMATHY K (2025). MATLAB AND ARDUINO SERIAL COMMUNICATION (https://fr.mathworks.com/matlabcentral/fileexchange/64709-matlab-and-arduino-serial-communication), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Plateformes compatibles
Windows macOS LinuxCatégories
Tags
Remerciements
Inspiré par : Simple GUI for serial port communication, MATLAB And Arduino Interfacing, Find Serial Ports
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
SERIAL_COMMUNICATION/
| Version | Publié le | Notes de version | |
|---|---|---|---|
| 1.0.0.0 |
.
|
