Borrar filtros
Borrar filtros

App Designer And Arduino (Reading continuous voltage from Potentiometer )

4 visualizaciones (últimos 30 días)
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.

Respuestas (1)

Roja Boran Gökhan
Roja Boran Gökhan el 13 de Oct. de 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

Categorías

Más información sobre Arduino Hardware en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by