Need help with arduino-serial?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

221 Stars 81 Forks MIT License 17 Commits 10 Opened issues


Example C and Java host code to talking to an arduino or other "serial" device

Services available


Need anything else?

Contributors list

# 54,676
12 commits
# 1,757
1 commit

arduino-serial -- C code to talk to Arduino

Original URL:

Post about changes:


laptop%  ./arduino-serial
Usage: arduino-serial -b  -p  [OPTIONS]

  -h, --help                 Print this help message
  -b, --baud=baudrate        Baudrate (bps) of Arduino (default 9600)
  -p, --port=serialport      Serial port Arduino is connected to
  -s, --send=string          Send string to Arduino
  -S, --sendline=string      Send string with newline to Arduino
  -r, --receive              Receive string from Arduino & print it out
  -n  --num=num              Send a number as a single byte
  -F  --flush                Flush serial port buffers for fresh reading
  -d  --delay=millis         Delay for specified milliseconds
  -e  --eolchar=char         Specify EOL char for reads (default '\n')
  -t  --timeout=millis       Timeout for reads in millisecs (default 5000)
  -q  --quiet                Don't print out as much info

Note: Order is important. Set '-b' baudrate before opening port'-p'.
      Used to make series of actions: '-d 2000 -s hello -d 100 -r'
      means 'wait 2secs, send 'hello', wait 100msec, get reply'


For convenience, here's some pre-built versions of arduino-serial. They may not be updated regularly, so compile it yourself if you can. Click the "view raw" to get the actual zip file.



arduino-serial should compile on any POSIX-compatible system. Tested on Mac OS X, Ubuntu Linux, Raspian Linux, Beaglebone Linux

To build, just check it out, make, and run it like:

% git clone
% cd arduino-serial
% make
% ./arduino-serial

For more details on the build process, see the Makefile.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.