Created
May 25, 2012 11:17
-
-
Save n9986/2787394 to your computer and use it in GitHub Desktop.
Simple way to save memory on Serial.print on Arduino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __COMMON__ | |
#define __COMMON__ | |
#include "Arduino.h" | |
//#define DEBUG_ON | |
#ifdef DEBUG_ON | |
#define initLog(speed) Serial.begin(speed) | |
#define log(buf) Serial.print(buf) | |
#define logLine(buf) Serial.println(buf) | |
#else | |
#define initLog(speed) | |
#define log(buf) | |
#define logLine(buf) | |
#endif | |
#endif // __COMMON__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment