Why does the MATLAB support for Arduino use a different command syntax?

9 vues (au cours des 30 derniers jours)
uopdon
uopdon le 21 Juil 2015
The Arduino command for configuring the digital pins is pinMode()
eg. pinMode(3,OUTPUT) configures digital pin 3 as an output.
In MATLAB I have to use a different command syntax, namely configureDigitalPin()
eg. configureDigitalPin(a,3,'output')
where 'a' is the arduino object
I am deterred by this because I cannot easily develop my program in MATLAB and deploy on the Arduino without changing alot of code.
I have seen a third syntax which goes like this, a.pinMode(), where 'a' is still the Arduino object.
eg. a.pinMode(3,OUTPUT)
This is much better - the syntax is exactly the same as Arduino syntax, with the 'a.' added. I can easily change this to embed the code in the Arduino by a simple find and replace of 'a.' for '' (nothing). Also I don't have to learn two separate commands for the same command.
Can someone explain how I can enable this final form of the syntax?

Réponses (0)

Catégories

En savoir plus sur Arduino Hardware dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by