6

I'm testing out an accelerometer and I want to know if there's a way to make it so that the serial monitor will update the values without printing a new line. Ideally the serial monitor would say something like:

Accelerometer X: $xval
Accelerometer y: $yval

and then instead of printing two new lines each time, it just updates the values. Is there anyway to do that in Arduino? Thanks.

  • What happens if you make the serial monitor 20 lines long. And then print your 2 lines + 18 lines? I'm not sure, but it might fake a 'value update' – Paul Apr 17 '15 at 12:41
6

The ultra-basic "serial monitor" in the Arduino IDE cannot do what you want.

Instead you need to either write a special client program, or use a more standard serial terminal program, such as Tera Term (Windows), Minicom (Linux), etc.

These standard serial terminal programs use a special sequence of characters called ANSI escape codes which manipulate the display, doing such things as setting colours, moving the cursor around, etc.

More information on ANSI escape codes can be found here: http://en.wikipedia.org/wiki/ANSI_escape_code

3

No. The serial monitor does not support terminal handling. Either use a serial communications program that does and use those features, or write a custom client that will only update those values in its interface.

  • Okay, thanks. Is there any other client that's recommended? – Hammad Apr 16 '15 at 16:47
  • Not really. Most serial programs, even Hyperterminal (or whatever Windows drags along these days) will do. – Ignacio Vazquez-Abrams Apr 16 '15 at 22:17
1

You might want to look into processing. You can use that to view the accelerometers position in 3d and see the values changing if that's what you want. The official Arduino site talks about it here. Here is a great tutorial on it.

  • I would recommend this as a client option. – NULL Apr 16 '15 at 18:18
  • Probably would have been better as a comment on Ignacio But yes processing is a good option IF you want to write code by yourself. – Paul Apr 17 '15 at 12:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.