Feature request - Serial monitor control sequences

38 views
Skip to first unread message

EF

unread,
Jan 8, 2014, 2:20:36 PM1/8/14
to devel...@arduino.cc
Dear IDE-Developers!
 
As far as I could find out there is no possibility to move the cursor position in the serial monitor. When I started with arduino, I tried to use some VT100-commands, but nothing worked. I simply wanted to show imput values on a fixed screen position to have a kind of "screen-mask" for my output values. I think, this was a helpful option for other novices too.
 
Maybe it is possible to implement some very simple control sequences like #p(10,10)# for "Position" and #cls# for "Clear screen". Any other solution, maybe also a minimal subset of VT100, was also welcome. Is somebody able to so this for one of the next Versions?
 
Best Regards
Eckehard
 
 
 

S S

unread,
Jan 8, 2014, 3:29:33 PM1/8/14
to EF, Arduino Developers
I'm not a regular contributor, I mostly follow this list for the inside news, but I have a minor suggestion for the implementation of this.

I recoded a serial LCD backpack design once (I didn't like any of the open source ones already available), and made use of several of the Ascii control codes. I re-purposed some of the codes entirely, but several have essentially the ascii function. The most useful are Backspace, Horizontal Tab, Line Feed, Vertical Tab, Form Feed, and Carriage Return. Those are decimal commands 8 through 13, but are also represented in C/C++ by "\b", "\t", "\n", "\v", "\f", "\r". As far as I know, all of these commands work on the Arduino side, and I think the Serial monitor does at least understand "\n" (newline) and "\t" (H. tab). Even if just the rest of these were supported, it would be a great improvement. I think the most useful of them is form feed ("\f").

Anyway, using the Ascii command set doesn't add any additional "special" characters to printing strings, and makes use of built in C/C++ functionality.

DM

Knight, Dave

unread,
Jan 8, 2014, 3:38:34 PM1/8/14
to EF, Arduino Developers
FWIW, I like to use an openSource (serial) terminal emulator like minicom instead of the Arduino "serial monitor". 

It's not quite as convenient as the serial monitor, because you do have to know what "device"is associated with the IDE serial port ( it must be started from the command line or a handy shell script like my "saveLog" script:

#!/bin/bash
#
if [ "x$1" = x ]
then echo "Usage: $0 filename [device]"
     echo "           default device is ttyACM0"
  exit 1
else LOGFILE=$1
fi

if [ "x$2" = "x" ]
then DEVICE=ttyACM0
else DEVICE=$2
fi

# default concatenation of logs to same filename
#
echo "################  `date`" >> $LOGFILE
minicom -D /dev/$DEVICE -C $LOGFILE

stopped manually before an upload (it's not stopped automatically by the IDE), but it provides some important features that seem to be unavailable with the serial monitor, including the ability to:

  - copy/paste serial input & output (e.g. into an email)

  - capture serial input/output to a log file (see -C flag in script above)

  - responds to ASCII control chars, because it's a terminal emulator not just a serial monitor.

Logfile capture is especially useful when developing & documenting a serial command/user interface in a sketch.

Hope this helps...



--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.



--
Liberal/progressive dogma asserts that me must not judge all Muslims by the actions of a few lunatics, yet insists that we judge all gun owners by the actions of a few lunatics... oh, the irony!



Reply all
Reply to author
Forward
0 new messages