Hello everybody,
i'm trying to acquire data through arduino and plotting them with matlab. I need a sampling frequency of at least 1 kHz, but from tests made with a potentiometer it seems to be around 30Hz. Is it a matlab problem or an arduino problem? Which is the maximum sampling frequency of arduino? I have an arduino uno r3, and to interface it with matlab i've used the specific toolbox from mathworks. I attach the matlab code used for the acquisition:
passo=1;
interv=1000;
t=1;
x=0;
while(t<interv)
b=a.analogRead(0);
x=[x,b];
plot(x);
axis([0 interv 0 1023]);
grid
t=t+passo;
drawnow
end
I've also tried preallocating the array but strangely performance seems to go down.
Thanks for your help.