フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

i correctly wrote code for timer for due ?

1 回表示 (過去 30 日間)
Minjae Yoo
Minjae Yoo 2018 年 4 月 8 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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

回答 (0 件)

この質問は閉じられています。

製品

Community Treasure Hunt

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

Start Hunting!

Translated by