I'm trying to plot the data in Matlab, where I save the text file from Arduino nano in Coolterm. The circuit is basically two sensors output voltage in two channels using AnalogRead(). Then I realize the time intervals are irregular in my plot, which seems to cause by the inconsistent sampling rate. Can someone please help me to increase and fix the sampling frequency to 250 Hz? Thank you for answering.
I realize the time intervals are irregular in my plot, which seems to cause by the inconsistent sampling rate. Can someone please help me to increase and fix the sampling frequency to 250 Hz?
I'm certain someone could if you posted your code.
Is your Arduino code generating the timestamps and sending them to CoolTerm along with your data, or are you having CoolTerm add timestamps to received data? The latter is not recommended if precise timing is required as serial communication is asynchronous and the speed and frequency with which CoolTerm can receive and record data is variable and highly dependent on the performance of the hardware it runs on.