example_lib.cpp (Source)

/*
 * Licence: LGPL 
 * Autor: Gilhad
*/

#include "example_lib.h"
#include <Print.h>

example_lib::example_lib(logger &l, const char *name):param(name),l(l){
	l.info("constructor - name = ",param);
	l.info("constructor - test err");
	l.error("problem in constructor");
	l.info("constructor - after test err");
	// Ó díky Arduino za tvou magii - V KONSTRUKTORECH NELZE PŘÍČETNĚ POUŽÍVAT SERIAL !!!!!!  
	// neboť následná automagická inicializace Serial pohltí buffer a zasekne výstup/výpočet
	// takže flushovat co to dá a doufat, že automagie neudeří uprostřed.
};
void example_lib::begin(){
	l.info("begin - param=",param);
	l.error("problem in begin");
};
void example_lib::doit(int i){
	l.info("in doit()");
	l.info("lib name = ",param);
	l.info("doit with ",i);
	l.info("doit with 0x",i,HEX);
	l.info("doit with 0b",i,BIN);
	if ((i==4) or (i==18)) l.error("Indecent! ",i,BIN);
	else l.info("OK");
};