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
12extern HardwareSerial &ArduinoSerial;
13
14void 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
16template <class logLine>
17void 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
34template <class logLine>
35void 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}
HardwareSerial & ArduinoSerial
Printing serial messages to the Arduino Serial output and the esp-link Microcontroller Console (uC Co...
void logToSerials(const __FlashStringHelper *ToPrint, bool BreakLine=true, uint8_t Indent=3)
logs to both Arduino and ESP Link serial console, 2 optional parameters to adding a break line at aft...
Definition SerialLog.cpp:5