Skip to content

Instantly share code, notes, and snippets.

@chrwei chrwei/serial_test.ino
Last active Nov 15, 2015

What would you like to do?
* Serial echo for verifying communication with a PC based program
* On Galileo or Edison this can talk to a process on the host
* if you setup socat to create some devices.
#if defined(__ARDUINO_X86__)
//Galileo or Edison, setup ring buffer and TTYUARTClass
RingBuffer rx_buffer_S1;
TTYUARTClass mySerial(&rx_buffer_S1, 3, false);
//all other configuration use the first serial UART
#define mySerial Serial
void setup() {
#if defined(__ARDUINO_X86__)
//for Galileo or Edison specify the host TTY to connect to
//now the mySerial instance can be treated just like any Serial instance
void loop()
if(mySerial.available()) {
char in =;
if(in == 'A') {
} else {
You can’t perform that action at this time.