kopia lustrzana https://github.com/kosme/arduinoFFT
Ensure accurate sampling frequency in FFT_03.ino
rodzic
92f4066a72
commit
c564008306
|
@ -53,15 +53,15 @@ void setup()
|
|||
void loop()
|
||||
{
|
||||
/*SAMPLING*/
|
||||
microseconds = micros();
|
||||
for(int i=0; i<samples; i++)
|
||||
{
|
||||
microseconds = micros(); //Overflows after around 70 minutes!
|
||||
|
||||
vReal[i] = analogRead(CHANNEL);
|
||||
vImag[i] = 0;
|
||||
while(micros() - microseconds < sampling_period_us){
|
||||
//empty loop
|
||||
}
|
||||
microseconds += sampling_period_us;
|
||||
}
|
||||
/* Print the results of the sampling according to time */
|
||||
Serial.println("Data:");
|
||||
|
|
Ładowanie…
Reference in New Issue