arduino-sketch.ino 341 B

123456789101112
  1. void setup() {
  2. // $ stty -F /dev/ttyUSB0 | grep speed
  3. Serial.begin(115200);
  4. // A0 for compatibility with analog configuration
  5. pinMode(A0, INPUT);
  6. }
  7. void loop() {
  8. // effective sample rate measured with "Probe Rate" block
  9. // $ tail --follow /dev/ttyUSB0 | od --format=u1 --width=1
  10. Serial.write(digitalRead(A0));
  11. }