|
/*
|
|
* Licence: GPL 2.0
|
|
* Autor: Gilhad
|
|
*/
|
|
|
|
#include "logging_serial.h"
|
|
#include "example_lib.h"
|
|
|
|
|
|
logger_serial mylog(LOG_NONE),liblog("lib_1"),libloge("lib_2",LOG_ERROR);
|
|
|
|
example_lib lib1(liblog,"First Lib");
|
|
example_lib lib2(libloge,"Second Lib");
|
|
|
|
void setup(){
|
|
Serial.begin(9600); // Re-inicializace pote, co spontální re-inicializace Serial přepsala hodnoty nastavené v logging_serial
|
|
mylog.info("In setup()");
|
|
lib1.begin();
|
|
lib2.begin();
|
|
};
|
|
|
|
int i;
|
|
void loop(){
|
|
delay(1000);
|
|
mylog.info("In loop()");
|
|
lib1.doit(i);
|
|
lib2.doit(i);
|
|
mylog.log(12,"--------------------------");
|
|
i++;
|
|
if (i>20) {
|
|
i=0;
|
|
if (libloge.set_level==LOG_NONE) libloge.set_level=LOG_ERROR;
|
|
else libloge.set_level=LOG_NONE;
|
|
};
|
|
};
|