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

2 ビュー (過去 30 日間)
uopdon
uopdon 2015 年 7 月 21 日
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?

回答 (0 件)

カテゴリ

Help Center および File ExchangeArduino Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by