Matlab Adruino Uno project troubleshooting

6 visualizzazioni (ultimi 30 giorni)
James Panhorst
James Panhorst il 6 Mag 2019
Risposto: Mark Sherstan il 17 Mag 2019
So I recreated the project used on this link, https://www.instructables.com/id/Arduino-Controlling-LEDs-With-a-4x4-Keypad/ and am having trouble converting the adruino code to a matlab code. And after that am also having trouble getting the lights to work after uploading through the adruino app.

Risposte (1)

Mark Sherstan
Mark Sherstan il 17 Mag 2019
Read through the Arduino getting started support package for MATLAB. It has all the tools you need: https://www.mathworks.com/help/supportpkg/arduinoio/index.html?s_tid=CRUX_lftnav
To get you started your code will look something like this in MATLAB:
...
a = arduino();
writeDigitalPin(a,'D5',1);
pause(0.1)
a = arduino();
writeDigitalPin(a,'D5',0);
...
Which is the same as (Arduino):
...
digitalWrite(5, HIGH);
delay(100);
digitalWrite(5, LOW);
...
Once you get through the material let me know if you have specific questions.

Categorie

Scopri di più su Instrument Control Toolbox in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by