Skip to content

Instantly share code, notes, and snippets.

@stoph
Created July 7, 2022 16:36
Show Gist options
  • Save stoph/5cff02301e3cae322adc619a9c473a20 to your computer and use it in GitHub Desktop.
Save stoph/5cff02301e3cae322adc619a9c473a20 to your computer and use it in GitHub Desktop.
Arduino debugger
namespace
{
template<typename T1>
void debug(T1 v){
#ifdef ENABLE_DEBUG
Serial.println(v);
#endif
}
template<typename T2>
void debug(String k, T2 v){ // char *k
#ifdef ENABLE_DEBUG
Serial.print(k);
Serial.print(": ");
Serial.println(v);
#endif
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment