Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/todbot/arduino-serial
Example C and Java host code to talking to an arduino or other "serial" device
https://github.com/todbot/arduino-serial
Last synced: 5 days ago
JSON representation
Example C and Java host code to talking to an arduino or other "serial" device
- Host: GitHub
- URL: https://github.com/todbot/arduino-serial
- Owner: todbot
- License: mit
- Created: 2010-05-12T07:54:54.000Z (over 14 years ago)
- Default Branch: main
- Last Pushed: 2021-02-11T02:58:23.000Z (almost 4 years ago)
- Last Synced: 2025-01-16T05:06:50.272Z (12 days ago)
- Language: C
- Homepage: http://todbot.com/blog/
- Size: 274 KB
- Stars: 236
- Watchers: 30
- Forks: 84
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-arduino - arduino-serial - Example C and Java host code to talking to an Arduino or other "serial" device (Libraries)
- awesome-arduino - arduino-serial - Example C and Java host code to talking to an Arduino or other "serial" device (Libraries)
README
arduino-serial -- C code to talk to Arduino
===========================================Original URL: http://todbot.com/blog/2006/12/06/arduino-serial-c-code-to-talk-to-arduino/
Post about changes: http://todbot.com/blog/2013/04/29/arduino-serial-updated/
Usage
------
laptop% ./arduino-serial
Usage: arduino-serial -b -p [OPTIONS]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 infoNote: 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'Downloads
---------
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.- https://github.com/todbot/arduino-serial/blob/master/arduino-serial-macosx.zip
- https://github.com/todbot/arduino-serial/blob/master/arduino-serial-linux.zipCompilation
-----------
arduino-serial should compile on any POSIX-compatible system.
Tested on Mac OS X, Ubuntu Linux, Raspian Linux, Beaglebone LinuxTo build, just check it out, make, and run it like:
% git clone https://github.com/todbot/arduino-serial.git
% cd arduino-serial
% make
% ./arduino-serialFor more details on the build process, see the Makefile.