|
| void | beginStartupText () |
| | Serial settings for the startup text: 9600 baud 8N1, the default of serial monitors.
|
| |
| bool | busy () |
| | Whether an output is still in progress.
|
| |
| void | complete () |
| | Write whatever is left of the current output to Serial, waiting like a plain print.
|
| |
| template<bool IOT> |
| void | endStartupText () |
| | Serial settings after the startup text: 7E1 for the IoT telemetry frames, as the mk2Wifi module expects; unchanged for the other outputs.
|
| |
| void | poll (Print &out=Serial) |
| | Write as many steps as the transmit buffer can take, without waiting.
|
| |
| void | printDecimals (Print &out, int32_t value, uint8_t decimals) |
| | Print a value given as an integer with a fixed number of decimals (see toDecimals())
|
| |
| void | printHundredths (Print &out, int16_t value_x100) |
| | Print a value given in hundredths, in its shortest decimal form.
|
| |
| void | runStep (Print &out) |
| | Run the next step of the current output.
|
| |
| bool | start (Step step) |
| | Start an output, written by later calls to poll()
|
| |
| template<uint8_t N> |
| constexpr DecimalsTable< N > | toDecimals (const float(&values)[N], uint8_t decimals) |
| | A float array constant as integers with the given number of decimals, rounded.
|
| |
| constexpr int32_t | toDecimals (float value, uint8_t decimals) |
| | A float constant as an integer with the given number of decimals, rounded.
|
| |
| void SerialOutput::printDecimals |
( |
Print & | out, |
|
|
int32_t | value, |
|
|
uint8_t | decimals ) |
|
inline |
Print a value given as an integer with a fixed number of decimals (see toDecimals())
printDecimals(out, 50000, 6) -> "0.050000", printDecimals(out, -5, 2) -> "-0.05". What Print::print(float, decimals) wrote, without its float code.
- Parameters
-
| out | where to write |
| value | the value, times 10^decimals |
| decimals | the number of decimals |
Definition at line 197 of file serial_output.h.
| void SerialOutput::printHundredths |
( |
Print & | out, |
|
|
int16_t | value_x100 ) |
|
inline |
Print a value given in hundredths, in its shortest decimal form.
2137 -> "21.37", 2150 -> "21.5", 2100 -> "21", -5 -> "-0.05". What ArduinoJson wrote for the float value / 100, without its float noise (it wrote -9.969999 for -997).
- Parameters
-
| out | where to write |
| value_x100 | the value, in hundredths |
Definition at line 117 of file serial_output.h.
| int32_t SerialOutput::toDecimals |
( |
float | value, |
|
|
uint8_t | decimals ) |
|
constexpr |
A float constant as an integer with the given number of decimals, rounded.
For compile time only (constexpr variables): Print::print(float) costs about 1 kB of float code, printDecimals() only integer divisions. toDecimals(0.05F, 6) -> 50000, printed by printDecimals(out, 50000, 6) as "0.050000".
- Parameters
-
| value | the float constant |
| decimals | the number of decimals |
- Returns
- the value times 10^decimals, rounded
Definition at line 151 of file serial_output.h.