A much smaller and more efficient serial library than Arduinos Serial.
A much smaller and more efficient serial library than Arduinos Serial.
Use one include file to replace the Serial.print from Arduino library.
Use one include file to replace the Serial.print from Arduino library.
##### Table of Contents
**Table of Contents**
[What is the problem with Arduino Serial.print ?](#arduino_serial_problems)
[What is the problem with Arduino Serial.print ?](#what-is-the-problem-with-arduino-serialprint-)
[Example comparison between Didel TerSer and Arduino Serial](#example_comparison)
[Example comparison between Didel TerSer and Arduino Serial](#example-comparison-between-didel-terser-and-arduino-serial)
[Using tabular data](#using_tabular_data)
[Using tabular data](#using-tabular-data)
[TerSer Limitations](#terser_limitations)
[TerSer Limitations](#terser-limitations)
[Code size and timing comparison](#code_size_timing_comparison)
[Code size and timing comparison](#code-size-and-timing-comparison)
<aname="arduino_serial_problems"/>
### What is the problem with Arduino Serial.print ?
### What is the problem with Arduino Serial.print ?
Serial.print is is most of the time used as a debugging tool, and with limited resources it is even more important to have the most lighweight solution for this task.
Serial.print is is most of the time used as a debugging tool, and with limited resources it is even more important to have the most lighweight solution for this task.
@ -38,7 +37,6 @@ It is admittedly very convenient to just use Serial.print(var); since it doesn't
Filling the non significative digits with zero or space is a general options, named ShowZ(); and HideZ();
Filling the non significative digits with zero or space is a general options, named ShowZ(); and HideZ();
@ -56,7 +54,6 @@ HideZ();Dec8s(3); SetTab(15);
It is up to you to add functions like TextNL();
It is up to you to add functions like TextNL();
if you need to keep your Serial.println() habits.
if you need to keep your Serial.println() habits.
<aname="terser_limitations"/>
### TerSer Limitations
### TerSer Limitations
TerSer does not print floating point numbers.
TerSer does not print floating point numbers.
The may happen some day with one more file to import, e.g. names TerFloat.h.
The may happen some day with one more file to import, e.g. names TerFloat.h.
@ -65,7 +62,6 @@ Dec8(); and Dec16(); use a tricky macro to recognize the signed or unsigned data
Code will be shorter and there will be no limitation if you use Dec8u(any unsigned expr); and
Code will be shorter and there will be no limitation if you use Dec8u(any unsigned expr); and
Dec8s(any signed expr);, same of course Dec16u(); and Dec16s();
Dec8s(any signed expr);, same of course Dec16u(); and Dec16s();
<aname="code_size_timing_comparison"/>
### Code size and timing comparison
### Code size and timing comparison
Code size has been obtained by calling one function at a time, compiler under the usual -0s mode. Size is the difference with the empty file size. TerSer.h can of course be used with setup() and loop(). It add the ~300 bytes Arduino initializations.
Code size has been obtained by calling one function at a time, compiler under the usual -0s mode. Size is the difference with the empty file size. TerSer.h can of course be used with setup() and loop(). It add the ~300 bytes Arduino initializations.
Execution time has been measured with a Nop replacing the SendCar function. The time depends on the baud rate, ~1 ms per character displayed at 9600 bits/s.
Execution time has been measured with a Nop replacing the SendCar function. The time depends on the baud rate, ~1 ms per character displayed at 9600 bits/s.