Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
i correctly wrote code for timer for due ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!