Gbox
4.20
Grow box automation and monitoring - <a href='https://sites.google.com/site/growboxguy/'>https://sites.google.com/site/growboxguy/</a>
Loading...
Searching...
No Matches
SerialLog.h
Go to the documentation of this file.
1
#pragma once
2
9
#include "Arduino.h"
10
11
//Forward declaration
12
extern
HardwareSerial &
ArduinoSerial
;
13
14
void
logToSerials
(
const
__FlashStringHelper *ToPrint,
bool
BreakLine =
true
,
byte
Indent = 3);
//logs to the Arduino serial output, 2 optional parameters to adding a break line at after printing and the indentation in front
15
16
template
<
class
logLine>
17
void
logToSerials
(logLine *ToPrint,
bool
BreakLine =
true
,
byte
Indent = 3)
18
{
19
while
(Indent > 0)
20
{
21
ArduinoSerial
.print(F(
" "
));
22
Indent--;
23
}
24
if
(BreakLine)
25
{
26
ArduinoSerial
.println((*ToPrint));
27
}
28
else
29
{
30
ArduinoSerial
.print((*ToPrint));
31
}
32
}
33
34
template
<
class
logLine>
35
void
logToSerials
(logLine &ToPrint,
bool
BreakLine =
true
,
byte
Indent = 3)
36
{
37
while
(Indent > 0)
38
{
39
ArduinoSerial
.print(F(
" "
));
40
Indent--;
41
}
42
if
(BreakLine)
43
{
44
ArduinoSerial
.println(ToPrint);
45
}
46
else
47
{
48
ArduinoSerial
.print(ToPrint);
49
}
50
}
ArduinoSerial
HardwareSerial & ArduinoSerial
Printing serial messages to the Arduino Serial output and the esp-link Microcontroller Console (uC Co...
Definition
Gbox420_Mega_Main.ino:33
logToSerials
void logToSerials(const __FlashStringHelper *ToPrint, bool BreakLine=true, uint8_t Indent=3)
< Logging
Definition
SerialLog.cpp:5
Gbox420_Nano_Reservoir
SerialLog.h
Generated by
1.9.8