Hi,
I am declaring instance of my own Traces class like that :
/*
Traces.cpp for traces output.
Copyright (c) Nicolas VALENTIN 2010
12 Oct 2010 - First Version
2010 nov. 20 Adding Special Features Writing Direction
*/
#include "WProgram.h"
#include "Traces.h"
#include "Time.h"
#include <Wire.h>
#include <Utils.h>
#include <DS1307.h>
#include <LiquidCrystal.h>
//=============================================================================
//=============================================================================
Traces Tracer = Traces();
/* set fdm=marker */
/*
traces.h - low level traces functions
*/
#ifndef _Traces_h
#define _Traces_h
#include "WProgram.h"
#include <inttypes.h>
#include <LiquidCrystal.h>
#include "Time.h"
// #include <QueueList.h>
class Traces
{
public:
//=============================================================================
private:
//=============================================================================
//=============================================================================
//=============================================================================
};
/* set fdm=marker */
extern Traces Tracer;
#endif /* _Traces_h */
and in my setup I pass it to others classes :
/*
CoreSystem
Manage Main Loop to control some electrical feature
*/
#include <inttypes.h>
#include <Time.h>
// niva add features
#include <Traces.h>
#include <Utils.h>
#include <PinManager.h>
#include <FunctionalTasks.h>
#include <FunctionalWrapper.h>
#include <LcdMenu.h>
#include <Alarm.h>
#include <AlarmsManager.h>
#include <Wire.h>
#include <LiquidCrystal.h>
#include <DS1307.h> // written by mattt on the Arduino forum and modified by D. Sjunnesson
#include <SRF02.h>
#include <UltrasonCmd.h>
#include <MemoryFree.h>
#include <QueueList.h>
/* Arduino Lcd 2x16
*
* VSS Pin 1
* VDD Pin 2
* VSS Pin 3
* Pin 7 Pin 4
* VSS Pin 5
* Pin 8 Pin 6
* NA Pin 7
* NA Pin 8
* NA Pin 9
* NA Pin 10
* Pin 9 Pin 11
* Pin 10 Pin 12
* Pin 11 Pin 13
* Pin 12 Pin 14
* VDD Pin 15
* VSS Pin 16
*
*
*/
LiquidCrystal lcd(7, 8, 9, 10, 11, 12) ;
SRF02 sonicsensor = SRF02(0x70, SRF02_CENTIMETERS);
FunctionalTasks FuncTask ;
// ENTREES
//
// SETUP
//
void setup() {
// SERIAL
Serial.begin(9600);
// LCD
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.clear();
delay(2000);
PinMng.setTracer(&Tracer);
// pass lcd to tracer and tracer to all others objects
Tracer.setLcd(&lcd);
delay(200);
// FuncTask.setSonicSensor(&sonicsensor);
// UltraSonic Sensor
UltraCmd.setSonicSensor(&sonicsensor);
UltraCmd.setDistToOnRelays(180);
UltraCmd.setTracer(&Tracer);
// FunctionalTask
FuncTask.setTracer(&Tracer);
FuncTask.setPinManager(&PinMng);
// FuncTask.setRealTimeClock(); //!!! only if date is out of date
// Bind the wrapper to FunctionalTasks p and call procedure
FunctionalWrapper::setObj(FuncTask);
//
Tracer.LcdDelayPrintTopLineFromLeft("Ecran.........OK");
// CONFIGURATION
FuncTask.ConfigPinsRelays();
Tracer.LcdDelayPrintBottomLineFromLeft("Config Pins...OK");
delay(300);
FuncTask.displayRelayConfig();
// AUTOTEST RELAIS
// FuncTask.Autotests();
// TESTS SECTION OF ALARM {{{1
void PinManager::setTracer(Traces *TracerPtr) {
if ( TracerPtr != NULL )
{
_Tracer = TracerPtr;
}
}
class PinManager
{
public:
PinManager();
void setTracer(Traces *TracerPtr);
And in all of class the setter is like that :
I would like to know if there is a mismatch cause my lcd screen display bad unknown characters.