Skip to content

Instantly share code, notes, and snippets.

@twolfson
Created July 31, 2019 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twolfson/6a621609b0e1d12023b57bd969b33b44 to your computer and use it in GitHub Desktop.
Save twolfson/6a621609b0e1d12023b57bd969b33b44 to your computer and use it in GitHub Desktop.
Proof of concept for reading serial output from Arduino directly

gist-arduino-serial

Proof of concept for reading serial output from Arduino directly

Getting started

  • Clone the repo
  • Upload .ino file to Arduino (e.g. via IDE)
  • Verify output is being seen via Serial Monitor in Arduino IDE
  • Open terminal, listen to same port that Arduino writes to
    • tail -f /dev/ttyACM0 on Linux
    • May require more setup on other platforms
  • See output in terminal and be happy =)
// #include <Wire.h>
int i = 0;
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop() {
i += 1;
// String output = "Hello";
// String output2 = output + i;
// Serial.println(output2);
Serial.println(i);
// Wire.write((byte) i);
delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment