Hi everybody!
Now i am doing a small project with Arduino Nano 3 and Matlab 2007a. Arduino Nano 3 is connected to my laptop via usb.
I used Matlab command:
a = arduino;
[code]v = readVoltage(a,'A0');
to read data from a sensor, then i plotted it in the real time, saved data in a variable of array.
to do more signal processing like filter received data...etc, i really need to know the sampling frequency.
So the main question is that:
how can i set the sampling frequency for the command "readVoltage"?
or is there any command that read the data from the Arduino Nano 3 which i can specify the sampling frequency?
thank in advance!
kchientdc:
Hi everybody!
Now i am doing a small project with Arduino Nano 3 and Matlab 2007a. Arduino Nano 3 is connected to my laptop via usb.
I used Matlab command:
a = arduino;
[code]v = readVoltage(a,'A0');
to read data from a sensor, then i plotted it in the real time, saved data in a variable of array.
to do more signal processing like filter received data...etc, i really need to know the sampling frequency.
So the main question is that:
how can i set the sampling frequency for the command "readVoltage"?
or is there any command that read the data from the Arduino Nano 3 which i can specify the sampling frequency?
thank in advance!
Sounds like you need help with Matlab programming.
If I recall correctly, there is a specific sketch you upload to the arduino to make it work with Matlabs commands such as the one you have shown.
In that sketch you probably need to make some provisions to enable a certain sample rate, who knows how that function is actually accessing the arduinos ADC.
But that still leaves the question, how to make the arduinos(ATmega328) ADC sample at a particular rate. Guess the datasheet would be a good place to start because I don't think Arduino is supplying a way to control the sample rate, does it?