- rebuild your code within Simulink, as Simulink can generate for Arduino target
- use MATLAB Coder, marking all of the interesting parts as external, and write those yourself. That is, there is no support for generating code for writeDigital for example.
- whatever you can put together based on the custom code libraries discussed at https://www.mathworks.com/help/supportpkg/arduinoio/custom-arduino-libraries.html
MATLAB Support Package for Arduino Hardware, does it compile the code or just send and recieve data?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Saeed
am 11 Feb. 2017
Beantwortet: Walter Roberson
am 11 Feb. 2017
Hi
I am trying to code an Arduino to do some stuff for me. For example I write this simple code:
a = arduino('com3', 'uno');
for i = 1:10
writeDigitalPin(a, 'D13', 0);
pause(0.5);
writeDigitalPin(a, 'D13', 1);
pause(0.5);
end
It works fine, but as soon as I disconnect it from PC and connect it to a electricity power source, it does not do the commands again, which means that the code is not recorded on the micro controller chipset and only transfers the command to the Arduino to do the work. In this case, the process is done by the CPU of the PC. This is obvious also because the TX and RX LEDs on the Arduino blink each time there is a new command passing the connection cable.
So, is there a way to compile the code and use it on the micro-controller?
Thanks
Saeed
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 11 Feb. 2017
You have a few choices:
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Arduino Hardware finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!