JoaoLopesF / RemoteDebug

Library for Arduino to debug projects over WiFi, with web app or telnet, with print commands like Serial Monitor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use in included files

flamedmg opened this issue · comments

C++ newb here. Could you please suggest or show small example of how to use logger if code consists of 3 files:

  • main.cpp
  • lib.cpp
  • lib.h

If i import RemoteDebug in lib.cpp, how do i use it later in main.cpp ? In my case there are way more files that needs access to that logger, but because debugV or other methods requires Debug variable i'm not sure how to use it.

I use a "Globals.h" file to do so, that consists of:

#include "RemoteDebug.h"
...
extern RemoteDebug Debug;
...

Then I include that one in all the files I need and use it normally.

commented

Mh still says undefined reference to Debug'` where are you initializing your debug instance ?