|
@@ -1,5 +1,5 @@
|
|
// https://www.arduino.cc/reference/en/language/functions/time/micros/
|
|
// https://www.arduino.cc/reference/en/language/functions/time/micros/
|
|
-const unsigned long SAMPLE_INTERVAL_MICROSECONDS = 2500L;
|
|
+const unsigned long SAMPLE_INTERVAL_MICROSECONDS = 2000L;
|
|
|
|
|
|
void setup() {
|
|
void setup() {
|
|
// $ stty -F /dev/ttyUSB0 | grep speed
|
|
// $ stty -F /dev/ttyUSB0 | grep speed
|
|
@@ -17,6 +17,7 @@ void loop() {
|
|
// https://www.arduino.cc/reference/en/language/functions/analog-io/analogread/
|
|
// https://www.arduino.cc/reference/en/language/functions/analog-io/analogread/
|
|
unsigned short reading = analogRead(A0);
|
|
unsigned short reading = analogRead(A0);
|
|
// $ tail --follow /dev/ttyUSB0 | od --format=u2 --endian=big --width=2
|
|
// $ tail --follow /dev/ttyUSB0 | od --format=u2 --endian=big --width=2
|
|
|
|
+ // 16 bits/sample / 115200 Baud * 1e6 μs/sec = 139 μs/sample
|
|
Serial.write(reading >> 8);
|
|
Serial.write(reading >> 8);
|
|
Serial.write(reading & 0xff);
|
|
Serial.write(reading & 0xff);
|
|
}
|
|
}
|