App Designer _ PushButton Callback
335 views (last 30 days)
Hello to everyone:)
I have a little problem with the PushButton Callback using AppDesinger.
Press PushButton: run motor via serial communication (Arduino)
Release PushButton: stop motor
Working with the App Designer is absolutely new for me - so thanks in advance for your help.
Abhilash Padma on 5 Nov 2019
It is better to use “State Button” rather than “Push Button” in app designer in your use case. When the Push Button is clicked once, the button appears to press and release. When the State Button is clicked, the button remains in the pressed or released state until it is clicked again. Use the “value” variable in the ButtonValueChanged callback of the State Button to run or stop your motor. Look at the following callback code of State Button which might help you.
function ButtonValueChanged(app, event)
value = app.Button.Value;
% command to run motor
% command to stop motor