02_logging.ino 360 B

123456789101112131415161718192021222324252627
  1. template <typename T>
  2. void debug(T val) {
  3. #ifdef DEBUG
  4. Serial.print(val);
  5. #endif
  6. }
  7. template <typename T>
  8. void debugln(T val) {
  9. #ifdef DEBUG
  10. Serial.println(val);
  11. #endif
  12. }
  13. template <typename T, typename Y>
  14. void debugln(T str, Y val) {
  15. #ifdef DEBUG
  16. Serial.print(str);
  17. Serial.println(val);
  18. #endif
  19. }
  20. void debugln() {
  21. #ifdef DEBUG
  22. Serial.println();
  23. #endif
  24. }