我開始對採樣率和波特率等感到困惑。我有以下Arduino代碼:
#include <eHealth.h>extern volatile unsigned long timer0_overflow_count; float fanalog0; int模擬0; unsigned long time;字節serialByte; void setup(){Serial.begin(9600);} void loop(){而(Serial.available()>0){ ();如果(serialByte =='S'){while(1){fanalog0 = eHealth.getECG(); //使用timer0 = >每4 us 1個滴答時間=(timer0_overflow_count << 8)+ TCNT0; //微秒轉換。時間=(時間* 4); //打印文件進行仿真//Serial.print(time); //Serial.print(“”); Serial.print(fanalog0,5); Serial.print(“ \ n”);如果(Serial.available()>0){serialByte = Serial.read();如果(serialByte =='F')中斷; }}}}}
既然沒有延遲中斷,那麼採樣率/頻率是多少?它基於Arduino ADC的速度嗎?當我增加波特率時,我是在增加採樣頻率還是在通過串行端口發送數據的速率?