Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

i correctly wrote code for timer for due ?

1 visualización (últimos 30 días)
Minjae Yoo
Minjae Yoo el 8 de Abr. de 2018
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
Hello !
im using Due in Matlab.
with value change of writePosition fuctions.
together i want make plot in same time. so i used timer.
i correctly wrote but not work...
please help.
clc; clear all; close all; %Reset all
a=arduino('COM4','Due','Libraries','Servo'); %Set Arduinio board
ai_pin='A6'; %Set Analog pin for ADC
s = servo(a, 'D7');
tic; %Set stopwatch timer
i=0; %Set i for measure length
pause(5); %Delay 2 sec
time = str2num(get(handles.edit3,'String'));
step_input = 0.25;
writePosition(s, step_input); %1ms
pause(2);
step_input(i) = 0.79;
writePosition(s, step_input(i))
%step_input(i) = 0.79;
%writePosition(s, step_input(i)); %2ms
while (toc<999)
i=i+1;
t(i)=toc;
step_response(i)=readVoltage(a,ai_pin); %Already voltages calculated
figure(1)
plot(t,step_response,'r');
pause(0.1);
end

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by