p-v-o-s / Arduino-SerialCommand

A Wiring/Arduino library to tokenize and parse commands received over a serial port.
3 stars 3 forks source link

Termination character - might be '\r' #2

Open benjaminaigner opened 7 years ago

benjaminaigner commented 7 years ago

On some setups (e.g. Debian + Minicom), commands are not recognized at all.

Changing the variable "term" to '\r' fixes this issue.

cversek commented 7 years ago

Unfortunately, termination characters are platform specific. I usually use Linux where the line termination norm is '\n', on OS X I believe it is '\r', on Windows it's '\r\n', and many serial terminal programs also use '\r\n' by default. Feel free to change this line to suit your preference or change what the serial terminal program sends. I generally use pyserial on linux to send commands and I always have to explicitly send '\n'.

I'll leave this issue open, since it would be nice to have a way to configure the line termination without editing the library code.