Hey guys,
i have a question concerning using a #define made in the sketch file in my library.
I want the user of my lib be able to set a debug #define which decides if he wants debug output or not.
(eg. #define DEBUGGING true)
To achieve this i have the following code:
.ino file:
/// PRE DEFINES
/// ============================================================================
///
#define INOMATION_AUTH_KEY "bWF4OjhBdHJKRk5hbXBMYzhpOEpURQ=="
#define INOMATION_DEBUGGING true
/// Webduino Settings. Decomment to activate
#define WEBDUINO_SERIAL_DEBUGGING 2
// #define WEBDUINO_READ_TIMEOUT_IN_MS 1000
// #define WEBDUINO_COMMANDS_COUNT 8
// #define WEBDUINO_URL_PATH_COMMAND_LENGTH 8
// #define WEBDUINO_FAIL_MESSAGE "<h1>EPIC FAIL</h1>"
// #define WEBDUINO_AUTH_REALM "Webduino"
// #define WEBDUINO_AUTH_MESSAGE "<h1>401 Unauthorized</h1>"
// #define WEBDUINO_SERVER_ERROR_MESSAGE "<h1>500 Internal Server Error</h1>"
// #define WEBDUINO_OUTPUT_BUFFER_SIZE 32
// #define WEBDUINO_FAVICON_DATA { 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x10, \
// 0x10, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, \
// 0xb0, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, \
// 0x00, 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, \
// 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, \
// 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, \
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
// 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, \
// 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, \
// 0x00, 0xff, 0xff, 0x00, 0x00, 0xcf, 0xbf, \
// 0x00, 0x00, 0xc7, 0xbf, 0x00, 0x00, 0xc3, \
// 0xbf, 0x00, 0x00, 0xc1, 0xbf, 0x00, 0x00, \
// 0xc0, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, \
// 0x00, 0xc0, 0xbf, 0x00, 0x00, 0xc1, 0xbf, \
// 0x00, 0x00, 0xc3, 0xbf, 0x00, 0x00, 0xc7, \
// 0xbf, 0x00, 0x00, 0xcf, 0xbf, 0x00, 0x00, \
// 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, \
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
// 0x00, 0x00 }
/// INCLUDES
/// ============================================================================
///
/// Standrad Arduino Libraries
#include <VirtualWire.h>
#include <Ethernet.h>
#include <SPI.h>
#include <RCSwitch.h>
#include <WebServer.h>
/// Non-Standard Arduino Libraries. If you dont have them, download them.
#include "Inomation.h"
.h lib file:
/// Check if the Inomation Library is already included
#ifndef INOMATION_H_
#define INOMATION_H_
/// Needed for non -multiple integration of webduino implementation
#define WEBDUINO_NO_IMPLEMENTATION
///
/// INCLUDES and STRUCTS
/// ============================================================================
///
/// Include the main Arduino library.
#include "Arduino.h"
/// Including standard Arduino libraries needed in the project.
#include "SPI.h"
#include "VirtualWire.h"
#include "Ethernet.h"
#include "RCSwitch.h"
#include "WebServer.h"
/// DEFINITIONS
/// ============================================================================
///
#ifndef INOMATION_DEBUGGING
#define INOMATION_DEBUGGING false
#endif
The thing is, it isnt working. The output option always is set to false... so he does not overtake the true from the ino file.
Thanks for your help.