App Designer And Arduino (Reading continuous voltage from Potentiometer )
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
I am new to App designer. I am trying to read the voltage from Anaolog input from the Arduino uno and desplay the change of the voltage on Gauge using readVotage(), but it does not work. It read reads the first value when I first starts the app, but when I keep changing the voltage from the potentiometer, it does not update in the Gauge.
Here is the code.
function SwitchValueChanged(app, event)
value = app.Switch.Value; % using a sweitch just to controll the code and LED
voltage= readVoltage(app.a,"A0");
if value == "On"
writeDigitalPin(app.a,"D9",1);
app.Gauge.Value = voltage;
app.EditField.Value=voltage;
else
writeDigitalPin(app.a,"D9",0);
app.Gauge.Value = 0;
app.EditField.Value=0;
end
end
By the way, when I run the code in a normal Matlab scripts, it works prefect and the voltage reading updates whenever I change the value of the potentiometer.
Any help with explantion would be appriciate it.
Thank you in advance.
0 Kommentare
Antworten (1)
Roja Boran Gökhan
am 13 Okt. 2021
Hello, Could you find the answer? Because i got the same problem with you but i couldn't figure it out. I hope you can help me
0 Kommentare
Siehe auch
Kategorien
Mehr zu Arduino Hardware finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!