
ao0=analogoutput('nidaq');
ao1=analogoutput('nidaq');



addchannel(ao0, [0]);
addchannel(ao1, [1]);

sampleRate=50000;

set(ao0,'SampleRate',sampleRate);
set(ao0, 'TriggerType', 'Immediate');
set(ao0, 'RepeatOutput', 0);

set(ao1,'SampleRate',sampleRate);
set(ao1, 'TriggerType', 'Immediate');
set(ao1, 'RepeatOutput', 0);

disp('ENTER');
pause;

tic
t0=1;

putdata(ao0, 3.51);
putdata(ao1, 2.24);
start(ao0);
%start(ao1);

toc
disp('1º');
pause;

% waveData=5;
% waveData1=2.5;
f=0;

%tic
for i=1:0.05:4
    
waveData=i;
waveData1=i-1;

putdata(ao0, [waveData']);
start(ao0);
%  if i==3,
%     waveData=2;
%     waveData1=3;
%     putdata(ao, [waveData' waveData1']);
%      disp('medir a tensao');
%      pause;
%  end
 
 pause(0.05);
 
  f=f+1;  
end
%temp=toc

disp('2º');
pause;

z0=0;
putdata(ao0,z0);
start(ao0);
disp('3º');
pause;
numero_de_ciclos=f
tempo=temp
stop(ao0);
%delete(ao0);
