GUI to control arduino

4 ビュー (過去 30 日間)
Kenneth
Kenneth 2015 年 6 月 10 日
編集済み: Kenneth 2015 年 6 月 11 日
I am building a MATLAB GUI to control a motor using the motor shield on an Arduino. I can connect to the arduino and send commands to the motor just fine. Problem is I have added a push button to 'clear' the arduino object so that it doesn't remain attached after I close the GUI. I connect to the arduino by creating an object "ardobj=arduino('com5','uno')". If I do this from the command window then "clear ardobj" breaks the connection and clears out the object. I have a pushbutton on the GUI that causes the same command to be executed, but the connection is not broken. I know this because if I close the GUI and try to connect to the arduino from the command window I get an error message. What is different about the clear executed from within the GUI?

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 6 月 10 日
Try
delete(ardobj)
  1 件のコメント
Kenneth
Kenneth 2015 年 6 月 11 日
編集済み: Kenneth 2015 年 6 月 11 日
Did not work. delete works on files. Thanks for the suggestion.

サインインしてコメントする。

カテゴリ

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