First, hello everybody! This is my first post in the forum (though I have been reading silently up here).
Second, excuse me for my english I'm working in it.
Third:
I'm having trouble and I can't solve it despite I read a lot of pages and pages.
Briefly: I'm working in a project using LiquidCrystal lib among other things.
The project grew enough, so I began to separate it in multiple source files each with their respective header file.
I use some global variables which are declared in a header file using extern keyword and then defined once in a source file. That worked fine with integers and that kind of datatype.
The problem started when i attemped to do the same with a LiquidCrystal object, for example:
header.h
#ifndef _PANTALLAS_h
#define _PANTALLAS_h#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif#include "LiquidCrystal.h"
#define (.....................) //several definesextern LiquidCrystal lcd (OPER_DISPL_RS, OPER_DISPL_E, OPER_DISPL_DB4, OPER_DISPL_DB5, OPER_DISPL_DB6, OPER_DISPL_DB7); //Syntax lcd (rs, enable, d4, d5, d6, d7)
#endif
source.c
#include "header.h"
LiquidCrystal lcd (OPER_DISPL_RS, OPER_DISPL_E, OPER_DISPL_DB4, OPER_DISPL_DB5, OPER_DISPL_DB6, OPER_DISPL_DB7);
//Syntax lcd (rs, enable, d4, d5, d6, d7)
I got this error at the output:
Pantallas.cpp:9:19: error: redefinition of 'LiquidCrystal lcd'
Pantallas.h:26:22: error: 'LiquidCrystal lcd' previously declared here
The central question is: What is the way to get a global LiquidCrystal Object across multiple source files??
Thanks a lot!!!!!!!!