App Designer and Arduino
Show older comments
Hi,
I am designing an interface in the App Designer. I have an Arduino board connected to some sensors. I would like to be able to run the interface multiple times, but right now I run it once perfectly and when I click run again it tells me I have an existing connection at my COM port and I need to clear it. I am unsure how to do this as I am very new to app designer! Any help would be greatly appreciated!
Thanks!
4 Comments
Asad Mirza
on 20 Feb 2019
Mind posting some of app designer code for us?
I suspect what is happening is you're trying to connect to the arduino each time you say click a button to send a signal or something. What you should do instead is connect to the arduino once and then when you click the button to do something have the button code only send a signal rather than try to connect to the arduino.
I'd like to help more but I would need to see the code as it is first.
Allison McCrady
on 20 Feb 2019
Mohammed Yakoob
on 2 Sep 2024
Hello dear You can use a= arduino(com, Uno); For example to connect and in the another callback a=[]; to clear the port for new connection.
Mohammed Yakoob
on 19 Jan 2025
Moved: Walter Roberson
on 19 Jan 2025
Hello, I'm facing in problem that the internal buffers is fully and need to clear it, so how I can do this step when I am using arduino () class?
Accepted Answer
More Answers (2)
Kihak Lee
on 28 Dec 2019
0 votes
Dear Asad Mirza
I tested your attached files(Arduino_Ex.mlapp) several times. There is a problem in disconnect button.
When push disconnect button, error is happend. I can not fix it.
Plese check your code!
thanks
Mohammed Yakoob
on 19 Jan 2025
0 votes
Hello, I'm facing in problem that the internal buffers is fully and need to clear it, so how I can do this step when I am using arduino () class?
Categories
Find more on MATLAB Support Package for Arduino Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!