I have a code which samples the given input signals with sampling rate 256hz. I plotted the graph of FFT and was able to see the peaks at the expected frequencies.But I would like to know whether my ADC is sampling correctly or not?Is there a way to do it?`
void setup()
{ Serial.begin(38400);
}
const unsigned long READ_PERIOD = 3906; // 3906 us: 256 Hz
void loop() {
static unsigned long lastRead;
if (micros() - lastRead >= READ_PERIOD) {
lastRead += READ_PERIOD;
int val_a0 = analogRead(A0);
int val_a1 = analogRead(A3);
int val_a2 = analogRead(A5);
int val_a3 = analogRead(A7);
Serial.print(val_a0);
Serial.print(" ");
Serial.print(val_a1);
Serial.print(" ");
Serial.print(val_a2);
Serial.print(" ");
Serial.println(val_a3);
}
}