mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
1.8 KiB
1.8 KiB
PrintString
Arduino library to print to a String.
Description
PrintString is a class that buffers a number of print statements in a String. This String can be requested to process later.
- buffer slowly generated data, and send it with minimum time between bytes e.g. to maximize packets for Ethernet.
- print to buffer to see how many chars the output is; use to prevent "display line overflow" (e.g. floats)
There is a relation to https://github.com/RobTillaart/PrintCharArray and https://github.com/RobTillaart/PrintSize.
Interface
- PrintString() constructor.
- size_t write(uint8_t c) workhorse I of Print interface.
- size_t write(uint8_t * str, uint8_t length) workhorse II of Print interface.
- void clear() wipes the internal String buffer
- int size() current usage of the buffer.
- String getString() to access the buffer.
Operational
See examples.
Future
- testing
- examples
- add new ones
- rename examples
- add functions like repeat(char c) to inject e.g. 7 spaces etc.
- add error flag