master
parent 69bbd82a85
commit 1a8ea542be

@ -25,6 +25,7 @@ We propose to use a compact C portable library. Compatibility with an Oled displ
It is admittedly very convenient to just use Serial.print(var); since it doesn't require you to specify the type of variable. Though when trying for example to output data in tabular style the processor needs to know the data type used so that it can reserve the adequate space for it in its output. It might seem like a big inconvenience to specify the data type with any statement that outputs data over serial but then again for debugging purposes it makes perfectly sense in terms of speed AND size of the resulting code. By the same reasons we also do not use a buffer as it is needed only in specific situations. It is admittedly very convenient to just use Serial.print(var); since it doesn't require you to specify the type of variable. Though when trying for example to output data in tabular style the processor needs to know the data type used so that it can reserve the adequate space for it in its output. It might seem like a big inconvenience to specify the data type with any statement that outputs data over serial but then again for debugging purposes it makes perfectly sense in terms of speed AND size of the resulting code. By the same reasons we also do not use a buffer as it is needed only in specific situations.
The TerSer.h offer the choice of 4 print format for numbers. Signed variables have a + or sign in front. The TerSer.h offer the choice of 4 print format for numbers. Signed variables have a + or sign in front.
| Normal (moz=0) | Spaces (moz=1) | Zeros (moz=2) | Compact (moz=3) | Serial.print | | Normal (moz=0) | Spaces (moz=1) | Zeros (moz=2) | Compact (moz=3) | Serial.print |
| -------------- | -------------- | -------------- | -------------- | -------------- | | -------------- | -------------- | -------------- | -------------- | -------------- |
@ -33,7 +34,7 @@ The TerSer.h offer the choice of 4 print format for numbers. Signed variables ha
### How to switch from Arduino Serial ### How to switch from Arduino Serial
If you are looking for a drop-in replacement for Arduino Serial with a smaller memory footprint follow the procedure outlined below to quickly switch your project to Didel TerSer: If you are looking for a drop-in replacement for Arduino Serial with a smaller memory footprint follow the procedure outlined below to quickly switch your project to Didel TerSer:
* Add ** #include <TerSer.h> ** at the top of your sketch or select the library from your Arduino IDE (*Sketch* | *Include Library*) * Add `#include <TerSer.h>` at the top of your sketch or select the library from your Arduino IDE (*Sketch* | *Include Library*)
* Use the either the library function names we provide or define your own function names, for example: * Use the either the library function names we provide or define your own function names, for example:
`#define Serialprint(x) Text(x)` `#define Serialprint(x) Text(x)`
* Search for all occurences or `Serial.print` and replace with `Serialprint` * Search for all occurences or `Serial.print` and replace with `Serialprint`

Loading…
Cancel
Save