Ehealth. getECG() was not declared in scoop

Hello guys i just try this code on arduino ide 1.8 but it show me this message error

Arduino: 1.8.19 (Windows 7), Board: "Arduino Yún"

C:\Users\Pc\AppData\Local\Temp\arduino_modified_sketch_399649\ECGExampleSerial.ino: In function 'void loop()':

ECGExampleSerial:11:9: error: 'eHealth' was not declared in this scope

   ECG = eHealth.getECG(); // Utilise la méthode getECG() pour obtenir la valeur du capteur ECG

         ^~~~~~~

exit status 1

'eHealth' was not declared in this scope



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

and this this the code

#include <eHealth.h>


float ECG;

void setup() {
  Serial.begin(115200);  
}

void loop() {
  ECG = eHealth.getECG(); // Utilise la méthode getECG() pour obtenir la valeur du capteur ECG
  Serial.print("ECG value :  ");
  Serial.print(ECG, 2); 
  Serial.print(" V"); 
  Serial.println(""); 

  delay(1);
}

and this is the eHealth.cpp code

// include this library's description file
#include "eHealth.h"

getECG(void);
//***************************************************************
// Accelerometer Variables and definitions						*
//***************************************************************

	//! not the wire library, can't use pull-ups
	#include "i2c.h"
	
	//! Breakout board defaults to 1, set to 0 if SA0 jumper is set
	#define SA0 1  
		#if SA0
			#define MMA8452_ADDRESS 0x1D  //! SA0 is high, 0x1C if low
		#else
			#define MMA8452_ADDRESS 0x1C  
		#endif

	#define	int1Pin 2
	#define int2Pin 3

	//! Set the scale below either 2, 4 or 8.
	const byte scale = 2;

	//! Set the output data rate below. Value should be between 0 and 7.
	//! 0=800Hz, 1=400, 2=200, 3=100, 4=50, 5=12.5, 6=6.25, 7=1.56
	const byte dataRate = 0;

//***************************************************************
// BloodPressureSensor tables											*
//***************************************************************

	const int pressures[] = {85, 87, 88, 90, 91, 92, 94, 96, 98, 100, 101, 102, 103, 105, 106, 107, 108, 110, 112, 114, 122, 123, 124, 131, 137, 147, 153, 156 };                   
	//!                 	 |   |   |	 |   |   |   |   |   |    |    |    |    |    |     |    |    |    |    |    |   |    |    |    |    |    |    |    |                                    
	//!                   	 0   1   2   3   4   5   6   7   8    9   10   11   12   13    14   15    16   17   18  19  20   21   22   23   24   25   26   27 


	const double voltages[] = {1.120, 1.16, 1.1685, 1.180, 1.1860 , 1.21, 1.2227, 1.24, 1.254, 1.265, 1.27, 1.275, 1.2825, 1.290, 1.296, 1.316, 1.33 , 1.34 ,1.37, 1.39, 1.4535, 1.46, 1.465, 1.51, 1.557, 1.64, 1.68, 1.71}; 
	//!							|      |      |      |       |      |      |       |      |     |      |       |     |      |     |      |      |     |      |       |     |     |      |     |       |     |     |     |            
	//!							0      1      2      3       4      5      6       7      8     9     10      11     12     13    14     15     16    17    18      19      20    21    22     23    24     25    26    27


//***************************************************************
// Constructor of the class										*
//***************************************************************

	//! Function that handles the creation and setup of instances
	eHealthClass::eHealthClass(void) { /*void constructor*/ }
	

//***************************************************************
// Public Methods												*
//***************************************************************


	//!******************************************************************************
	//!	Name:	initPositionSensor()												*
	//!	Description: Initializes the position sensor and configure some values.		*
	//!	Param : void																*
	//!	Returns: void																*
	//!	Example: eHealth.initPositionSensor();										*
	//!******************************************************************************
#include "eHealth.h"

eHealthClass::eHealthClass() {
    position = NULL;
}

void eHealthClass::bodyPosition() {
    position = new uint8_t[6];
    // Initialisation des valeurs du tableau position
}

void eHealthClass::clearPosition() {
    if (position != NULL) {
        delete[] position;
        position = NULL;
    }
}




// Implémentation des autres méthodes de la classe eHealthClass...

	void eHealthClass::initPositionSensor(void)
	{
		byte c;

		/* Set up the interrupt pins, they're set as active high, push-pull */
		pinMode(int1Pin, INPUT);
		digitalWrite(int1Pin, LOW);
		pinMode(int2Pin, INPUT);
		digitalWrite(int2Pin, LOW);
  
		/* Read the WHO_AM_I register, this is a good test of communication */
		c = readRegister(0x0D);  // Read WHO_AM_I register
		if (c == 0x2A)	{ // WHO_AM_I should always be 0x2A
			initMMA8452(scale, dataRate);  // init the accelerometer if communication is good
			Serial.println("MMA8452Q is online...");
		} else {
			Serial.print("Could not connect to MMA8452Q: 0x");
			Serial.println(c, HEX);
			//while (1);  // Loop forever if communication doesn't happen
		}
	}


	//!******************************************************************************
	//!	Name:	initBloodPressureSensor()											*
	//!	Description: Initializes the BloodPressureSensor sensor.					*
	//!	Param : floar parameter with correction value 								*
	//!	Returns: void																*
	//!	Example: eHealth.initBloodPressureSensor();									*
	//!******************************************************************************

	void eHealthClass::initBloodPressureSensor(float parameter)
	{	
		float pressureMAPactual = 0;
		float pressureMAP = 0;
		float pressure = 0; //Pressure sensor lecture
		float pulse = 0; //Voltage pulses
		float voltage = 0;
		unsigned char state = 0;
		unsigned int  initial = 0;
		float pressuremmHG = 10;
		unsigned int i = 0; 
		boolean rank = 0; 

		double pastVoltages[30];
		double furtherVoltages[30];
		double aux[50];
		
		initial = digitalRead(5);      
		 
		/*while (initial == 1) {
			initial = digitalRead(5); //Waiting for pulse.
		}*/
	
		if (initial == 0) {
			char cont = 0;
			Serial.print("Measurement started ...............");
			Serial.println("Wait please................");    
			state = 1;    
			delay(3000);  // Wait for 5 seconds to eliminate noise measurement 
			pressureMAPactual=0;
			pressure = 0;
    
			while (initial == 0) {
				pressure = analogRead(4);// ----> Reading pressure sensor
				pulse = analogRead(5); // ----> Reading voltage pulses       
				initial = digitalRead(5); // ----> Start measure
			
				if ( cont == 30 ) {
					cont = 0;
				}
			
				aux[cont] = ( pressure * 5 ) / 1023; 
				cont ++;
				
				if (pressureMAPactual < pulse) { // Save max value
					pressureMAPactual = pulse;
					pressureMAP = pressure;

					for (int i = 0; i<30; i++) { 
						pressure = analogRead(4);// Reading pressure sensor
						furtherVoltages[i] = (pressure * 5) / 1023;
						pastVoltages[i] = aux[i];
					}
				}
			}
		

			voltage = 0; // Clear variable
	  
			for (int i = 0; i <30; i++) {
				voltage = voltage + furtherVoltages[i] + pastVoltages[i]; 
			} // Average value
	  
			voltage = (voltage / 60) + parameter ; // Correction value

			Serial.print("Average voltage : ");
			Serial.println(voltage);
			
			if (state == 1) { 
				i = 0; 
				rank = 0;

				while ((rank == 0) & (i <27)) { // Searching for range int table of voltages
					if (voltages[i] >= voltage ) { 
						rank = 1;
					}
					i++; 
				}
				i--;
				pressuremmHG = pressures[i-1] + (voltage - voltages[i-1]) * 100; // Asign pressure LUP.

				systolic = (int(pressuremmHG));
				diastolic = (int((pressuremmHG * 0.54) / 0.85 ) );
				state = 0; 
				pressureMAP = 0;
				pressureMAPactual=0;
				pressuremmHG = 0;
				voltage = 0;
				initial = 1;
			}
		}
	}


	
	//!******************************************************************************
	//!		Name:	initPulsioximeter()												*
	//!		Description: Initializes the pulsioximeter sensor.						*
	//!		Param : void															*
	//!		Returns: void															*
	//!		Example: eHealth.initPulsioximeter();									*
	//!******************************************************************************

	void eHealthClass::initPulsioximeter(void) 
	{
		// Configuring digital pins like INPUTS
		pinMode(13, INPUT);		pinMode(12, INPUT);
		pinMode(11, INPUT);		pinMode(10, INPUT);
		pinMode( 9, INPUT);		pinMode( 8, INPUT);
		pinMode( 7, INPUT);		pinMode( 6, INPUT);
		// attach a PinChange Interrupt to our pin on the rising edge
	}

	
	//!******************************************************************************
	//!		Name:	getTemperature()												*
	//!		Description: Returns the corporal temperature.							*
	//!		Param : void															*
	//!		Returns: float with the corporal temperature value.						*
	//!		Example: float temperature = eHealth.getTemperature();					*
	//!******************************************************************************

	float eHealthClass::getTemperature(void)
	{	
		//Local variables
		float Temperature; //Corporal Temperature 
		float Resistance;  //Resistance of sensor.
		float ganancia=5.0;
		float Vcc=3.3;
		float RefTension=3.0; // Voltage Reference of Wheatstone bridge.
		float Ra=4700.0; //Wheatstone bridge resistance.
		float Rc=4700.0; //Wheatstone bridge resistance.
		float Rb=821.0; //Wheatstone bridge resistance.
		int sensorValue = analogRead(A3);
		
		float voltage2=((float)sensorValue*Vcc)/1023; // binary to voltage conversion  

		// Wheatstone bridge output voltage.
		voltage2=voltage2/ganancia;
		// Resistance sensor calculate  
		float aux=(voltage2/RefTension)+Rb/(Rb+Ra);
		Resistance=Rc*aux/(1-aux);    
		if (Resistance >=1822.8) {
			// if temperature between 25ºC and 29.9ºC. R(tª)=6638.20457*(0.95768)^t
			Temperature=log(Resistance/6638.20457)/log(0.95768);  
		} else {
			if (Resistance >=1477.1){
					// if temperature between 30ºC and 34.9ºC. R(tª)=6403.49306*(0.95883)^t
					Temperature=log(Resistance/6403.49306)/log(0.95883);  
			} else {
				if (Resistance >=1204.8){
					// if temperature between 35ºC and 39.9ºC. R(tª)=6118.01620*(0.96008)^t
					Temperature=log(Resistance/6118.01620)/log(0.96008); 
				}
				else{
					if (Resistance >=988.1){
						// if temperature between 40ºC and 44.9ºC. R(tª)=5859.06368*(0.96112)^t
						Temperature=log(Resistance/5859.06368)/log(0.96112); 
					}
					else {
						if (Resistance >=811.7){
							// if temperature between 45ºC and 50ºC. R(tª)=5575.94572*(0.96218)^t
							Temperature=log(Resistance/5575.94572)/log(0.96218); 
						}
					}
				}
			}  
		}
		
		return Temperature;
	}

	//!******************************************************************************
	//!		Name:	getOxygenSaturation()											*
	//!		Description: Returns the oxygen saturation in blood in percent.			*
	//!		Param : void															*
	//!		Returns: int with the oxygen saturation value							*
	//!		Example: int SPO2 = eHealth.getOxygenSaturation();						*
	//!******************************************************************************

	int eHealthClass::getOxygenSaturation(void)
	{
		return SPO2;
	}

	//!******************************************************************************
	//!		Name:	getBPM()														*
	//!		Description: Returns the heart beats per minute.						*
	//!		Param : void															*
	//!		Returns: int with the beats per minute									*
	//!		Example: int BPM = eHealth.getBPM();									*
	//!******************************************************************************

	int eHealthClass::getBPM(void)
	{
		return BPM;
	}


	//!******************************************************************************
	//!		Name:	getSkinConductance()											*
	//!		Description: Returns the value of skin conductance.						*
	//!		Param : void															*
	//!		Returns: float with the value of skin conductance						*
	//!		Example: float conductance = eHealth.getSkinConductance();				*
	//!******************************************************************************

	float eHealthClass::getSkinConductance(void)
	{
		// Local variable declaration.   
		float resistance;
		float conductance;
		delay(1);
		
		// Read an analogic value from analogic2 pin.
		float sensorValue = analogRead(A2);
		float voltage = sensorValue*5.0/1023;

		conductance = 2*((voltage - 0.5) / 100000);

		// Conductance calculation
		resistance = 1 / conductance; 
		conductance = conductance * 1000000;
		delay(1);
		
		if (conductance > 1.0) 	return conductance;
		else return -1.0;
	}


	//!******************************************************************************
	//!		Name:	getSkinResistance()												*
	//!		Description: Returns the value of skin resistance.						*
	//!		Param : void															*
	//!		Returns: float with the value of skin resistance						*
	//!		Example: float resistance = eHealth.getSkinResistance();				*
	//!******************************************************************************

	float eHealthClass::getSkinResistance(void)
	{	
		// Local variable declaration.   
		float resistance;
		float conductance;
	
		// Read an analogic value from analogic2 pin.
		float sensorValue = analogRead(A2);
		float voltage = (sensorValue * 5.0) / 1023; 
	
		delay(2);
		conductance = 2*((voltage - 0.5) / 100000);
   
		//Conductance calcultacion
		resistance = 1 / conductance;
		delay(2);
	
		if (resistance > 1.0 ) return resistance;
		else return -1.0;
	}

	
	//!******************************************************************************
	//!		Name:	getSkinConductanceVoltage()										*
	//!		Description: Returns the skin conductance value in voltage .			*
	//!		Param : void															*
	//!		Returns: float with the skin conductance value in voltage 				*
	//!		Example: float volt = eHealth.getSkinConductanceVoltage();				*
	//!******************************************************************************

	float eHealthClass::getSkinConductanceVoltage(void)
	{
		delay(2);
	
		//Read analogic value from analogic2 pin.
		int sensorValue = analogRead(A2);
	
		//Convert the readed value to voltage.
		float voltage = ( sensorValue * 5.0 ) / 1023;

		delay(2);
		return voltage;
	}


	//!******************************************************************************
	//!		Name:	getECG()														*
	//!		Description: Returns an analogic value to represent the ECG.			*
	//!		Param : void															*
	//!		Returns: float with the ECG value in voltage			 				*
	//!		Example: float volt = eHealth.getECG();									*
	//!******************************************************************************

	float eHealthClass::getECG(void)
	{
		float analog0;
		// Read from analogic in. 
		analog0=analogRead(0);
		// binary to voltage conversion
		return analog0 = (float)analog0 * 5 / 1023.0;   
	}
	

	//!******************************************************************************
	//!		Name:	getBodyPosition()												*
	//!		Description: Returns the current body position.							*
	//!		Param : void															*
	//!		Returns: uint8_t with the the position of the pacient.	 				*
	//!		Example: uint8_t position = eHealth.getBodyPosition();					*
	//!******************************************************************************

	uint8_t eHealthClass::getBodyPosition(void)
	{
		static byte source;

		/* If int1 goes high, all data registers have new data */
		if (digitalRead(int1Pin)) {// Interrupt pin, should probably attach to interrupt function	
			readRegisters(0x01, 6, &data[0]);  // Read the six data registers into data array.
			
			/* For loop to calculate 12-bit ADC and g value for each axis */
			for (int i=0; i<6; i+=2) {
				accelCount[i/2] = ((data[i] << 8) | data[i+1]) >> 4;  // Turn the MSB and LSB into a 12-bit value
				
					if (data[i] > 0x7F) {
						accelCount[i/2] = ~accelCount[i/2] + 1;
						accelCount[i/2] *= -1;  // Transform into negative 2's complement #
					}
					
				accel[i/2] = (float) accelCount[i/2]/((1<<12)/(2*scale));  // get actual g value, this depends on scale being set
			}		
		}
		
		/* If int2 goes high, either p/l has changed or there's been a single/double tap */
		if (digitalRead(int2Pin)) {
			source = readRegister(0x0C);  // Read the interrupt source reg.
			
			if ((source & 0x10)==0x10)  // If the p/l bit is set, go check those registers
				portraitLandscapeHandler();      

			delay(50); // Delay here for a little printing visibility, make it longer, or delete it
		}

		delay(100);
  
		return bodyPos; 
	}


	//!******************************************************************************
	//!		Name:	getSystolicPressure()											*
	//!		Description: Returns the  value of the systolic pressure.				*
	//!		Param : void															*
	//!		Returns: int with the systolic pressure.								*
	//!		Example: int systolic = eHealth.getSystolicPressure();					*
	//!******************************************************************************

	int eHealthClass::getSystolicPressure(void)
	{
		return systolic;
	}


	//!******************************************************************************
	//!		Name:	getDiastolicPressure()											*
	//!		Description: Returns the  value of the diastolic pressure.				*
	//!		Param : void															*
	//!		Returns: int with the diastolic pressure.								*
	//!		Example: int diastolic = eHealth.getDiastolicPressure();				*
	//!******************************************************************************

	int eHealthClass::getDiastolicPressure(void)
	{
		return diastolic;
	}


	//!******************************************************************************
	//!		Name:	getAirFlow()													*
	//!		Description: Returns an analogic value to represent the air flow.		*
	//!		Param : void															*
	//!		Returns: int with the airFlow value (0-1023).							*
	//!		Example: int airFlow = eHealth.getAirFlow();							*
	//!******************************************************************************

	int eHealthClass::getAirFlow(void)
	{
		int airFlow = analogRead(A1);

		
		return airFlow; 
	}


	//!******************************************************************************
	//!		Name:	printPosition()													*
	//!		Description: Returns an analogic value to represent the air flow.		*
	//!		Param : uint8_t position : the current body position. 					*
	//!		Returns: void															*
	//!		Example: eHealth.printPosition(position);								*
	//!******************************************************************************

	void eHealthClass::printPosition( uint8_t position )
	{
		if (position == 1) {
			Serial.println("Supine position");    
		} else if (position == 2) {
			Serial.println("Left lateral decubitus");
		} else if (position == 3) {
			Serial.println("Rigth lateral decubitus");
		} else if (position == 4) {
			Serial.println("Prone position");
		} else if (position == 5) {
			Serial.println("Stand or sit position");
		} else  {
			Serial.println("non-defined position");
		}
	}

	
	//!******************************************************************************
	//!		Name:	readPulsioximeter()												*
	//!		Description: It reads a value from pulsioximeter sensor.				*
	//!		Param : void										 					*
	//!		Returns: void															*
	//!		Example: readPulsioximeter();											*
	//!******************************************************************************
 
	void eHealthClass::readPulsioximeter(void)
	{
		uint8_t digito[] = {0,0,0,0,0,0};

		uint8_t A = 0;
		uint8_t B = 0;
		uint8_t C = 0;
		uint8_t D = 0;
		uint8_t E = 0;
		uint8_t F = 0;
		uint8_t G = 0;

		for (int i = 0; i<6 ; i++) { // read all the led's of the module
			A = !digitalRead(13);
			B = !digitalRead(12);
			C = !digitalRead(11);
			D = !digitalRead(10);
			E = !digitalRead(9);
			F = !digitalRead(8);
			G = !digitalRead(7);
			
			digito[i] = segToNumber(A, B, C ,D ,E, F,G);    
			delayMicroseconds(2800); //2800 microseconds
		}

			SPO2 = 10 * digito[5] + digito[4];
			BPM  = 100 * digito[2] + 10 * digito[1] + digito[0];
	}
	

	//!******************************************************************************
	//!		Name: airflowWave()														*
	//!		Description: It prints air flow wave form in the serial monitor			*
	//!		Param : int air with the analogic value									*
	//!		Returns: void															*
	//!		Example: eHealth.airflowWave();											*
	//!******************************************************************************

	void eHealthClass::airFlowWave(int air)
	{
		for (int i=0; i < (air / 5) ; i ++) {  
				Serial.print("..");  
		}

		Serial.print("..");
		Serial.print("\n");
		delay(25);
	}


	//!******************************************************************************
	//!		Name: readGlucometer()													*
	//!		Description: It reads the data stored in the glucometer					*
	//!		Param : void															*
	//!		Returns: void															*
	//!		Example: eHealth.readGlucometer();										*
	//!******************************************************************************
	
	void eHealthClass::readGlucometer(void)
	{
		delay(100);
		Serial.begin(1200);
		delay(100);

		Serial.print("U"); // Start communication command. 
		delay(1000); // Wait while receiving data.

		Serial.print("\n"); 
		if (Serial.available() > 0) {
			length = Serial.read();// The protocol sends the number of measures 
			Serial.read(); // Read one dummy data

			for (int i = 0; i<length; i++) { // The protocol sends data in this order 
				glucoseDataVector[i].year = Serial.read(); 
				glucoseDataVector[i].month = Serial.read();
				glucoseDataVector[i].day = Serial.read();
				glucoseDataVector[i].hour = Serial.read();
				glucoseDataVector[i].minutes = Serial.read();

				Serial.read(); // Byte of separation must be 0x00.

				glucoseDataVector[i].glucose = Serial.read();
				glucoseDataVector[i].meridian = Serial.read();

				Serial.read(); // CheckSum 1
				Serial.read(); // CheckSum 2			
			}
		}
	}

	//!******************************************************************************
	//!		Name: getGlucometerLength()												*
	//!		Description: it returns the number of data stored in the glucometer		*
	//!		Param : void															*
	//!		Returns: uint8_t with length											*
	//!		Example: int length = eHealth.getGlucometerLength();					*
	//!******************************************************************************

	uint8_t eHealthClass::getGlucometerLength(void)
	{
		return length;
	}

	//!******************************************************************************
	//!		Name: numberToMonth()													*
	//!		Description: Convert month variable from numeric to character.			*
	//!		Param : int month in numerical format									*
	//!		Returns: String with the month characters (January, February...).		*
	//!		Example: Serial.print(eHealth.numberToMonth(month));					*
	//!******************************************************************************
	
	String eHealthClass::numberToMonth(int month)
	{
		if (month == 1)  return "January"; 
		else if (month == 2)  return "February";
		else if (month == 3)  return "March";
		else if (month == 4)  return "April";
		else if (month == 5)  return "May";
		else if (month == 6)  return "June";
		else if (month == 7)  return "July";
		else if (month == 8)  return "August";
		else if (month == 9)  return "September";
		else if (month == 10) return "October";
		else if (month == 11) return "November";
		else return "December";
	}

	
	//!******************************************************************************
	//!		Name:	version()														*
	//!		Description: It check the version of the library						*
	//!		Param : void															*
	//!		Returns: void															*
	//!		Example: eHealth.version();												*
	//!******************************************************************************

	int eHealthClass::version(void)
	{
		return 1;
	}


//***************************************************************
// Private Methods												*
//***************************************************************

	//! This function will read the p/l source register and
	//!	print what direction the sensor is now facing */
	
	void eHealthClass::portraitLandscapeHandler()
	{
		byte pl = readRegister(0x10);  // Reads the PL_STATUS register
		
		switch((pl&0x06)>>1)  // Check on the LAPO[1:0] bits
		{
			case 0:
				position[0] = 0;
			break;
			
			case 1:
				position[0] = 1;
			break;
			
			case 2:
				position[0] = 2;
			break;
			
			case 3:
				position[0] = 3;
			break;
		}
		
		if (pl&0x01)  // Check the BAFRO bit
			position[1] = 0;
		else
			position[1] = 1;
		if (pl&0x40)  // Check the LO bit
			position[2] = 0;
		else 
			position[2] = 1;
 
		bodyPosition();  
	}

/*******************************************************************************************************/

	//! Initialize the MMA8452 registers.

	void eHealthClass::initMMA8452(byte fsr, byte dataRate)
	{
		MMA8452Standby();  // Must be in standby to change registers
  
		/* Set up the full scale range to 2, 4, or 8g. */
		if ((fsr==2)||(fsr==4)||(fsr==8))
			writeRegister(0x0E, fsr >> 2);  
		else
			writeRegister(0x0E, 0);
			
		/* Setup the 3 data rate bits, from 0 to 7 */
		writeRegister(0x2A, readRegister(0x2A) & ~(0x38));
		
		if (dataRate <= 7)
			writeRegister(0x2A, readRegister(0x2A) | (dataRate << 3));
			
		/* Set up portrait/landscap registers */
		writeRegister(0x11, 0x40);  // Enable P/L
		writeRegister(0x13, 0x14);  // 29deg z-lock, 
		writeRegister(0x14, 0x84);  // 45deg thresh, 14deg hyst
		writeRegister(0x12, 0x05);  // debounce counter at 100ms
		
		/* Set up single and double tap */
		writeRegister(0x21, 0x7F);  // enable single/double taps on all axes
		writeRegister(0x23, 0x20);  // x thresh at 2g
		writeRegister(0x24, 0x20);  // y thresh at 2g
		writeRegister(0x25, 0x8);  // z thresh at .5g
		writeRegister(0x26, 0x30);  // 60ms time limit, the min/max here is very dependent on output data rate
		writeRegister(0x27, 0x28);  // 200ms between taps min
		writeRegister(0x28, 0xFF);  // 1.275s (max value) between taps max
		
		/* Set up interrupt 1 and 2 */
		writeRegister(0x2C, 0x02);  // Active high, push-pull
		writeRegister(0x2D, 0x19);  // DRDY int enabled, P/L enabled
		writeRegister(0x2E, 0x01);  // DRDY on INT1, P/L on INT2
		
		MMA8452Active();  // Set to active to start reading
	}

/*******************************************************************************************************/

	//! Sets the MMA8452 to standby mode. It must be in standby to change most register settings.
	
	void eHealthClass::MMA8452Standby()
	{
		byte c = readRegister(0x2A);
		writeRegister(0x2A, c & ~(0x01));
	}

/*******************************************************************************************************/

	//! Sets the MMA8452 to active mode. Needs to be in this mode to output data
	
	void eHealthClass::MMA8452Active()
	{
		byte c = readRegister(0x2A);
		writeRegister(0x2A, c | 0x01);
	}

/*******************************************************************************************************/	

	//! Read i registers sequentially, starting at address into the dest byte array.
	void eHealthClass::readRegisters(byte address, int i, byte * dest)
	{
		i2cSendStart();
		i2cWaitForComplete();
		
		i2cSendByte((MMA8452_ADDRESS<<1));	// write 0xB4
		i2cWaitForComplete();
		
		i2cSendByte(address);	// write register address
		i2cWaitForComplete();
		
		i2cSendStart();
		i2cSendByte((MMA8452_ADDRESS<<1)|0x01);	// write 0xB5
		i2cWaitForComplete();
		
		for (int j=0; j<i; j++) {
			i2cReceiveByte(TRUE);
			i2cWaitForComplete();
			dest[j] = i2cGetReceivedByte();	// Get MSB result
		}
		
		i2cWaitForComplete();
		i2cSendStop();
		
		cbi(TWCR, TWEN);// Disable TWI
		sbi(TWCR, TWEN);// Enable TWI
	}

/*******************************************************************************************************/

	//! Read a single byte from address and return it as a byte.
	
	byte eHealthClass::readRegister(uint8_t address)
	{
		byte data;
		
		i2cSendStart();
		i2cWaitForComplete();
		
		i2cSendByte((MMA8452_ADDRESS<<1));	// write 0xB4
		i2cWaitForComplete();
		
		i2cSendByte(address);	// write register address
		i2cWaitForComplete();
		
		i2cSendStart();
		
		i2cSendByte((MMA8452_ADDRESS<<1)|0x01);	// write 0xB5
		i2cWaitForComplete();
		i2cReceiveByte(TRUE);
		i2cWaitForComplete();
		
		data = i2cGetReceivedByte();	// Get MSB result
		i2cWaitForComplete();
		i2cSendStop();
		
		cbi(TWCR, TWEN);	// Disable TWI
		sbi(TWCR, TWEN);	// Enable TWI
		
		return data;
	}

/*******************************************************************************************************/

	//! Writes a single byte (data) into address 
	void eHealthClass::writeRegister(unsigned char address, unsigned char data)
	{
		i2cSendStart();
		i2cWaitForComplete();  
		i2cSendByte((MMA8452_ADDRESS<<1));// write 0xB4
		i2cWaitForComplete();  
		i2cSendByte(address);// write register address
		i2cWaitForComplete();  
		i2cSendByte(data);
		i2cWaitForComplete();  
		i2cSendStop();
	}

/*******************************************************************************************************/

	//! Assigns a value depending on body position.

	void eHealthClass::bodyPosition( void )
	{  
		if (( position[0] == 0 ) && (position[1] == 1) && (position [2] == 0)) {
			bodyPos = 1;
		} else if (( position[0] == 1 ) && (position[1] == 1) && (position [2] == 0)) {
			bodyPos = 1;
		} else if (( position[0] == 3 ) && (position[1] == 1) && (position [2] == 0)) {
			bodyPos = 1;
		} else if (( position[0] == 2 ) && (position[1] == 0) && (position [2] == 0)) {
			bodyPos = 1;
		} else if (( position[0] == 2 ) && (position[1] == 1) && (position [2] == 1)) {
			bodyPos = 1;
		} else if (( position[0] == 2 ) && (position[1] == 1) && (position [2] == 0)) {
			bodyPos = 1; 
			
		} else if (( position[0] == 0 ) && (position[1] == 1) && (position [2] == 1)) {
			bodyPos = 2;
		} else if (( position[0] == 0 ) && (position[1] == 0) && (position [2] == 1)) {
			bodyPos = 2;
			
		} else if (( position[0] == 1 ) && (position[1] == 1) && (position [2] == 1)) {
			bodyPos = 3;
		} else if (( position[0] == 1 ) && (position[1] == 0) && (position [2] == 1)) {
			bodyPos = 3;
		  
		} else if (( position[0] == 1 ) && (position[1] == 0) && (position [2] == 0)) {
			bodyPos = 4;
		} else if (( position[0] == 3 ) && (position[1] == 0) && (position [2] == 0)) {
			bodyPos = 4;
			
		} else if (( position[0] == 3 ) && (position[1] == 0) && (position [2] == 1)) {
			bodyPos = 5;
		} else if (( position[0] == 3 ) && (position[1] == 1) && (position [2] == 1)) {
			bodyPos = 5;
		} else if (( position[0] == 2 ) && (position[1] == 0) && (position [2] == 1)) {
			bodyPos = 5;
		} else  { 
			bodyPos = 6;
		}
	}

/*******************************************************************************************************/

	//! Converts from 7 segments to number.

	uint8_t eHealthClass::segToNumber(uint8_t A, uint8_t B, uint8_t C, uint8_t D, uint8_t E, uint8_t F, uint8_t G )
	{
		if ((A == 1) && (B == 1) && (C == 1) && (D == 0) && (E == 1) && (F == 1) && (G == 1)) {
			return 0;
	   
		} else if ((A == 0) && (B == 1) && (C == 0) && (D == 0) && (E == 1) && (F == 0) && (G == 0)) {  
			return 1;
		
		} else if ((A == 1) && (B == 1) && (C == 0) && (D == 1) && (E == 0) && (F == 1) && (G == 1)) { 
			return 2;
		
		} else if ((A == 1) && (B == 1) && (C == 0) && (D == 1) && (E == 1) && (F == 0) && (G == 1)) { 
			return 3;
		
		} else if ((A == 0) && (B == 1) && (C == 1) && (D == 1) && (E == 1) && (F == 0) && (G == 0)) { 
			return 4;
		
		} else if ((A == 1) && (B == 0) && (C == 1) && (D == 1) && (E == 1) && (F == 0) && (G == 1)) { 
			return 5;
		
		} else if ((A == 1) && (B == 0) && (C == 1) && (D == 1) && (E == 1) && (F == 1) && (G == 1)) { 
			return 6;
		
		} else if ((A == 1) && (B == 1) && (C == 0) && (D == 0) && (E == 1) && (F == 0) && (G == 0)) {
			return 7;  
		
		} else if ((A == 1) && (B == 1) && (C == 1) && (D == 1) && (E == 1) && (F == 1) && (G == 1)) { 
			return 8;
		
		} else if ((A == 1) && (B == 1) && (C == 1) && (D == 1) && (E == 1) && (F == 0) && (G == 1)) { 
			return 9;
			
		} else  {
			return 0;
		}
	}

/*******************************************************************************************************/

//***************************************************************
// Preinstantiate Objects										*
//***************************************************************

	eHealthClass eHealth = eHealthClass();






also this is the eHealth.h code

#ifndef eHealthClass_h
#define eHealthClass_h

#include "Arduino.h"

class eHealthClass {
public:
    eHealthClass();
    void initPositionSensor();
    void initBloodPressureSensor(float parameter);
    void initPulsioximeter();
    float getTemperature();
    int getOxygenSaturation();
    int getBPM();
    float getSkinConductance();
    float getSkinResistance();
    float getSkinConductanceVoltage();
    float getECG();
    uint8_t getBodyPosition();
    int getSystolicPressure();
    int getDiastolicPressure();
    int getAirFlow();
    void printPosition(uint8_t position);
    void readPulsioximeter();
    void airFlowWave(int air);
    void readGlucometer();
    uint8_t getGlucometerLength();
    int version();
    String numberToMonth(int month);
    struct glucoseData {
        uint8_t year;
        uint8_t month;
        uint8_t day;
        uint8_t hour;
        uint8_t minutes;
        uint8_t glucose;
        uint8_t meridian;
    };
    glucoseData glucoseDataVector[8];

private:
    void initMMA8452(byte fsr, byte dataRate);
    void MMA8452Standby();
    void MMA8452Active();
    void readRegisters(byte address, int i, byte * dest);
    byte readRegister(uint8_t address);
    void writeRegister(unsigned char address, unsigned char data);
    void portraitLandscapeHandler();
    void bodyPosition();
    uint8_t segToNumber(uint8_t A, uint8_t B, uint8_t C, uint8_t D, uint8_t E, uint8_t F, uint8_t G);

    int systolic;
    int diastolic;
    int BPM;
    int SPO2;
    uint8_t bodyPos;
    byte data[6];
    int accelCount[3];
    float accel[3];
    uint8_t* position; // changement ici
    uint8_t length;
};

#endif
#ifndef eHealthClass_h
#define eHealthClass_h

#include "Arduino.h"
#include "eHealth.h"
class eHealthClass {
public:
    eHealthClass();
    void initPositionSensor();
    void initBloodPressureSensor(float parameter);
    void initPulsioximeter();
    float getTemperature();
    int getOxygenSaturation();
    int getBPM();
    float getSkinConductance();
    float getSkinResistance();
    float getSkinConductanceVoltage();
    float getECG();
    uint8_t getBodyPosition();
    int getSystolicPressure();
    int getDiastolicPressure();
    int getAirFlow();
    void printPosition(uint8_t position);
    void readPulsioximeter();
    void airFlowWave(int air);
    void readGlucometer();
    uint8_t getGlucometerLength();
    int version();
    String numberToMonth(int month);
    struct glucoseData {
        uint8_t year;
        uint8_t month;
        uint8_t day;
        uint8_t hour;
        uint8_t minutes;
        uint8_t glucose;
        uint8_t meridian;
    };
    glucoseData glucoseDataVector[8];

private:
    void initMMA8452(byte fsr, byte dataRate);
    void MMA8452Standby();
    void MMA8452Active();
    void readRegisters(byte address, int i, byte * dest);
    byte readRegister(uint8_t address);
    void writeRegister(unsigned char address, unsigned char data);
    void portraitLandscapeHandler();
    void bodyPosition();
    uint8_t segToNumber(uint8_t A, uint8_t B, uint8_t C, uint8_t D, uint8_t E, uint8_t F, uint8_t G);

    int systolic;
    int diastolic;
    int BPM;
    int SPO2;
    uint8_t bodyPos;
    byte data[6];
    int accelCount[3];
    float accel[3];
    uint8_t* position; // changement ici
    uint8_t length;
};

#endif

any help please and thanks
`

Where do we find the eHealth library?


Please edit your post, select all code and click the <CODE/> button; next save your post. This will make it easier to read, easier to copy and the forum software will display it properly.

Your topic has been moved to a more suitable location on the forum; it does not sound that you have a problem with the IDE but more with your code.

1 Like

this is my first time thank you

As @sterretje asked, where did you get the eHealth library? Please provide a link to its GitHub page.

Are you sure you got the entire contents of the 'eHealth.h' file? I would expect to see the following line in there somewhere:

extern eHealthClass eHealth;

Yes this is the ehealth library

As I suspected, you don't have the complete 'eHealth.h' file. Look on the GitHub page you provided:

image

Yes in the link I put that all I find

Where is this line in the code you posted???
image

This is the original code but I get also error in ide arduino that that line shouldn't be in the last of code so I cut it and the error Disappears and I also get error because of pointer
uint8_t position so also change it to pointer

uint8_t* position

Seems like you're just throwing crap at the wall to see what sticks. That's a really difficult way to write code.

Try compiling again using the original library. Then, post the exact code you tried and the exact error messages you received.

1 Like

Hello is there any one who has the latest library for ide arduino of ehealth sensor platform please?

I have merged your topics due to them having too much overlap on the same subject matter @fame88.

In the future, please only create one topic for each distinct subject matter and be careful not to cause them to converge into parallel discussions.

The reason is that generating multiple threads on the same subject matter can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.

Thanks in advance for your cooperation.

this is the original error

Arduino: 1.8.19 (Windows 7), Board: "Arduino Yún"



In file included from C:\Users\Pc\Documents\Arduino\sketch_mar19b\sketch_mar19b.ino:1:0:

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth/eHealth.h:269:20: error: flexible array member 'eHealthClass::position' not at end of 'class eHealthClass'

   uint8_t position[];

                    ^

exit status 1

Error compiling for board Arduino Yún.



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

and this is the original eHealth.h code

/*
 *  eHealth sensor platform for Arduino and Raspberry from Cooking-hacks.
 *
 *  Description: "The e-Health Sensor Shield allows Arduino and Raspberry Pi 
 *  users to perform biometric and medical applications by using 9 different 
 *  sensors: Pulse and Oxygen in Blood Sensor (SPO2), Airflow Sensor (Breathing),
 *  Body Temperature, Electrocardiogram Sensor (ECG), Glucometer, Galvanic Skin
 *  Response Sensor (GSR - Sweating), Blood Pressure (Sphygmomanometer) and 
 *  Patient Position (Accelerometer)."
 *
 *  Copyright (C) 2012 Libelium Comunicaciones Distribuidas S.L.
 *  http://www.libelium.com
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Version 0.1
 *  Author: Ahmad Saad & Luis Martín
 */


// Ensure this library description is only included once
#ifndef eHealthClass_h
#define eHealthClass_h

#include "Arduino.h"

// Library interface description
class eHealthClass {
   
   public: 
  
   //***************************************************************
   // Constructor of the class                              *
   //***************************************************************
  
      //! Class constructor.
      eHealthClass(void);
       
   //***************************************************************
   // Public Methods                                    *
   //***************************************************************
      
      //! Initializes the position sensor and configure some values.
      /*!
      \param void
      \return void
      */   void initPositionSensor(void);
             
      //! Initializes the BloodPressureSensor sensor and configure some values
      /*!
      \param float parameter with correction value
      \return void
      */   void initBloodPressureSensor(float parameter);
      
      //! Initializes the pulsioximeter sensor and configure some values.
      /*!
      \param void
      \return void
      */   void initPulsioximeter(void);
               
      //! Returns the corporal temperature.
      /*!
      \param void
      \return float : The corporal temperature value.   
      */   float getTemperature( void );
      
      //! Returns the oxygen saturation in blood in percent.
      /*!
      \param void
      \return int : The oxygen saturation value. Normal values betwen 95-99%  
      */   int getOxygenSaturation(void);

      //! Returns the heart beats per minute. 
      /*!
      \param void
      \return int : The beats per minute. 
      */   int getBPM(void);
 
      //! Returns the value of skin conductance. 
      /*!
      \param void
      \return float : The skin conductance value.  
      */   float getSkinConductance(void);
      
      //! Returns the value of skin resistance. 
      /*!
      \param void
      \return float : The skin resistance value.  
      */   float getSkinResistance (void);
      
      //! Returns the value of skin conductance in voltage. 
      /*!
      \param void
      \return float : The skin conductance value in voltage (0-5v).  
      */   float getSkinConductanceVoltage(void);

      //! Returns an analogic value to represent the Electrocardiography.
      /*!
      \param void
      \return float : The analogic value (0-5V).  
      */   float getECG(void);

      //! Returns the body position.
      /*!
      \param void   
      \return uint8_t : the position of the pacient.
       *      1 == Supine position.
       *      2 == Left lateral decubitus.
       *      3 == Rigth lateral decubitus.
       *      4 == Prone position.
       *      5 == Stand or sit position
       */ uint8_t getBodyPosition(void);
       
      //! Returns the  value of the systolic pressure.
      /*!
      \param void   
      \return int : The systolic pressure.
      */   int getSystolicPressure(void);

      //! Returns the  value of the diastolic pressure.
      /*!
      \param void   
      \return int : The diastolic pressure.
      */   int getDiastolicPressure(void);

      //! Returns an analogic value to represent the air flow.
      /*!
      \param void   
      \return int : The value (0-1023) read from the analogic in.  
      */   int getAirFlow(void);

      //! Prints the current body position 
      /*!
      \param uint8_t position : the current body position.   
      \return void  
      */   void printPosition( uint8_t position );
      
      //! It reads a value from pulsioximeter sensor.
      /*!
      \param void
      \return void
      */   void readPulsioximeter(void);

      //!  Prints air flow wave form in the serial monitor
      /*!
      \param int air : analogic value to print. 
      \return void 
      */   void airFlowWave(int air);

      //!  Read the values stored in the glucometer. 
      /*!
      \param void
      \return void
      */   void readGlucometer(void);

      //!Returns the number of data stored in the glucometer.
      /*!
      \param void
      \return int : length of data 
      */   uint8_t getGlucometerLength(void);

      //!  Returns the library version 
      /*!
      \param void
      \return int : The library version. 
      */   int version(void);

      //! Convert month variable from numeric to character.
      /*!
       \param int month in numerical format.
       \return String with the month characters (January, February...).
       */   String numberToMonth(int month);

      //!Struct to store data of the glucometer.
      struct glucoseData {
         uint8_t year; 
         uint8_t month;
         uint8_t day;
         uint8_t hour;
         uint8_t minutes;
         uint8_t glucose;
         uint8_t meridian;
      };

      //!Vector to store the glucometer measures and dates.
      glucoseData glucoseDataVector[8];

   private:

   //***************************************************************
   // Private Methods                                    *
   //***************************************************************

      //! Initialize the MMA8452 registers 
      void initMMA8452(byte fsr, byte dataRate);

      //! Sets the MMA8452 to standby mode. It must be in standby to change most register settings.
      void MMA8452Standby();
      
      //! Sets the MMA8452 to active mode. Needs to be in this mode to output data.
      void MMA8452Active();

      //! Read i registers sequentially, starting at address into the dest byte array
      void readRegisters(byte address, int i, byte * dest);

      //! Read a single byte from address and return it as a byte.
      byte readRegister(uint8_t address);

      //! Writes a single byte (data) into address.
      void writeRegister(unsigned char address, unsigned char data);

      //! This function will read the p/l source register and
      //! print what direction the sensor is now facing. 
      void portraitLandscapeHandler();

      //! Assigns a value depending on body position.
      void bodyPosition(void);
      
      //! Converts from 7 segments to number.
      uint8_t segToNumber(uint8_t A,
                     uint8_t B,
                     uint8_t C,
                     uint8_t D,
                     uint8_t E,
                     uint8_t F,
                     uint8_t G );


   //***************************************************************
   // Private Variables                                 *
   //***************************************************************

      //! It stores the systolic pressure value
      int systolic;

      //! It stores the diastolic pressure value
      int diastolic;

      //! It stores the  beats per minute value.
      int BPM;
      
      //! It stores blood oxigen saturation value.
      int SPO2;
      
      //! It stores current body position.
      uint8_t bodyPos; 

      //! x/y/z accel register data store here.
      byte data[6];

      //! Stores the 12-bit signed value.
      int accelCount[3];

      //! Stores the real accel value in g's.
      float accel[3];  

      //! Stores the body position in vector value. 
      uint8_t position[];

      //!It stores the number of data of the glucometer.
      uint8_t length;
};

extern eHealthClass eHealth;

#endif

and this is the original eHealth.cpp code

/*
 *  eHealth sensor platform for Arduino and Raspberry from Cooking-hacks.
 *
 *  Description: "The e-Health Sensor Shield allows Arduino and Raspberry Pi 
 *  users to perform biometric and medical applications by using 9 different 
 *  sensors: Pulse and Oxygen in Blood Sensor (SPO2), Airflow Sensor (Breathing),
 *  Body Temperature, Electrocardiogram Sensor (ECG), Glucometer, Galvanic Skin
 *  Response Sensor (GSR - Sweating), Blood Pressure (Sphygmomanometer) and 
 *  Patient Position (Accelerometer)."
 *
 *  Copyright (C) 2012 Libelium Comunicaciones Distribuidas S.L.
 *  http://www.libelium.com
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Version 0.1
 *  Author: Ahmad Saad & Luis Martín
 */


// include this library's description file
#include "eHealth.h"


//***************************************************************
// Accelerometer Variables and definitions						*
//***************************************************************

	//! not the wire library, can't use pull-ups
	#include "i2c.h"
	
	//! Breakout board defaults to 1, set to 0 if SA0 jumper is set
	#define SA0 1  
		#if SA0
			#define MMA8452_ADDRESS 0x1D  //! SA0 is high, 0x1C if low
		#else
			#define MMA8452_ADDRESS 0x1C  
		#endif

	#define	int1Pin 2
	#define int2Pin 3

	//! Set the scale below either 2, 4 or 8.
	const byte scale = 2;

	//! Set the output data rate below. Value should be between 0 and 7.
	//! 0=800Hz, 1=400, 2=200, 3=100, 4=50, 5=12.5, 6=6.25, 7=1.56
	const byte dataRate = 0;

//***************************************************************
// BloodPressureSensor tables											*
//***************************************************************

	const int pressures[] = {85, 87, 88, 90, 91, 92, 94, 96, 98, 100, 101, 102, 103, 105, 106, 107, 108, 110, 112, 114, 122, 123, 124, 131, 137, 147, 153, 156 };                   
	//!                 	 |   |   |	 |   |   |   |   |   |    |    |    |    |    |     |    |    |    |    |    |   |    |    |    |    |    |    |    |                                    
	//!                   	 0   1   2   3   4   5   6   7   8    9   10   11   12   13    14   15    16   17   18  19  20   21   22   23   24   25   26   27 


	const double voltages[] = {1.120, 1.16, 1.1685, 1.180, 1.1860 , 1.21, 1.2227, 1.24, 1.254, 1.265, 1.27, 1.275, 1.2825, 1.290, 1.296, 1.316, 1.33 , 1.34 ,1.37, 1.39, 1.4535, 1.46, 1.465, 1.51, 1.557, 1.64, 1.68, 1.71}; 
	//!							|      |      |      |       |      |      |       |      |     |      |       |     |      |     |      |      |     |      |       |     |     |      |     |       |     |     |     |            
	//!							0      1      2      3       4      5      6       7      8     9     10      11     12     13    14     15     16    17    18      19      20    21    22     23    24     25    26    27


//***************************************************************
// Constructor of the class										*
//***************************************************************

	//! Function that handles the creation and setup of instances
	eHealthClass::eHealthClass(void) { /*void constructor*/ }
	

//***************************************************************
// Public Methods												*
//***************************************************************


	//!******************************************************************************
	//!	Name:	initPositionSensor()												*
	//!	Description: Initializes the position sensor and configure some values.		*
	//!	Param : void																*
	//!	Returns: void																*
	//!	Example: eHealth.initPositionSensor();										*
	//!******************************************************************************

	void eHealthClass::initPositionSensor(void)
	{
		byte c;

		/* Set up the interrupt pins, they're set as active high, push-pull */
		pinMode(int1Pin, INPUT);
		digitalWrite(int1Pin, LOW);
		pinMode(int2Pin, INPUT);
		digitalWrite(int2Pin, LOW);
  
		/* Read the WHO_AM_I register, this is a good test of communication */
		c = readRegister(0x0D);  // Read WHO_AM_I register
		if (c == 0x2A)	{ // WHO_AM_I should always be 0x2A
			initMMA8452(scale, dataRate);  // init the accelerometer if communication is good
			Serial.println("MMA8452Q is online...");
		} else {
			Serial.print("Could not connect to MMA8452Q: 0x");
			Serial.println(c, HEX);
			//while (1);  // Loop forever if communication doesn't happen
		}
	}


	//!******************************************************************************
	//!	Name:	initBloodPressureSensor()											*
	//!	Description: Initializes the BloodPressureSensor sensor.					*
	//!	Param : floar parameter with correction value 								*
	//!	Returns: void																*
	//!	Example: eHealth.initBloodPressureSensor();									*
	//!******************************************************************************

	void eHealthClass::initBloodPressureSensor(float parameter)
	{	
		float pressureMAPactual = 0;
		float pressureMAP = 0;
		float pressure = 0; //Pressure sensor lecture
		float pulse = 0; //Voltage pulses
		float voltage = 0;
		unsigned char state = 0;
		unsigned int  initial = 0;
		float pressuremmHG = 10;
		unsigned int i = 0; 
		boolean rank = 0; 

		double pastVoltages[30];
		double furtherVoltages[30];
		double aux[50];
		
		initial = digitalRead(5);      
		 
		/*while (initial == 1) {
			initial = digitalRead(5); //Waiting for pulse.
		}*/
	
		if (initial == 0) {
			char cont = 0;
			Serial.print("Measurement started ...............");
			Serial.println("Wait please................");    
			state = 1;    
			delay(3000);  // Wait for 5 seconds to eliminate noise measurement 
			pressureMAPactual=0;
			pressure = 0;
    
			while (initial == 0) {
				pressure = analogRead(4);// ----> Reading pressure sensor
				pulse = analogRead(5); // ----> Reading voltage pulses       
				initial = digitalRead(5); // ----> Start measure
			
				if ( cont == 30 ) {
					cont = 0;
				}
			
				aux[cont] = ( pressure * 5 ) / 1023; 
				cont ++;
				
				if (pressureMAPactual < pulse) { // Save max value
					pressureMAPactual = pulse;
					pressureMAP = pressure;

					for (int i = 0; i<30; i++) { 
						pressure = analogRead(4);// Reading pressure sensor
						furtherVoltages[i] = (pressure * 5) / 1023;
						pastVoltages[i] = aux[i];
					}
				}
			}
		

			voltage = 0; // Clear variable
	  
			for (int i = 0; i <30; i++) {
				voltage = voltage + furtherVoltages[i] + pastVoltages[i]; 
			} // Average value
	  
			voltage = (voltage / 60) + parameter ; // Correction value

			Serial.print("Average voltage : ");
			Serial.println(voltage);
			
			if (state == 1) { 
				i = 0; 
				rank = 0;

				while ((rank == 0) & (i <27)) { // Searching for range int table of voltages
					if (voltages[i] >= voltage ) { 
						rank = 1;
					}
					i++; 
				}
				i--;
				pressuremmHG = pressures[i-1] + (voltage - voltages[i-1]) * 100; // Asign pressure LUP.

				systolic = (int(pressuremmHG));
				diastolic = (int((pressuremmHG * 0.54) / 0.85 ) );
				state = 0; 
				pressureMAP = 0;
				pressureMAPactual=0;
				pressuremmHG = 0;
				voltage = 0;
				initial = 1;
			}
		}
	}


	
	//!******************************************************************************
	//!		Name:	initPulsioximeter()												*
	//!		Description: Initializes the pulsioximeter sensor.						*
	//!		Param : void															*
	//!		Returns: void															*
	//!		Example: eHealth.initPulsioximeter();									*
	//!******************************************************************************

	void eHealthClass::initPulsioximeter(void) 
	{
		// Configuring digital pins like INPUTS
		pinMode(13, INPUT);		pinMode(12, INPUT);
		pinMode(11, INPUT);		pinMode(10, INPUT);
		pinMode( 9, INPUT);		pinMode( 8, INPUT);
		pinMode( 7, INPUT);		pinMode( 6, INPUT);
		// attach a PinChange Interrupt to our pin on the rising edge
	}

	
	//!******************************************************************************
	//!		Name:	getTemperature()												*
	//!		Description: Returns the corporal temperature.							*
	//!		Param : void															*
	//!		Returns: float with the corporal temperature value.						*
	//!		Example: float temperature = eHealth.getTemperature();					*
	//!******************************************************************************

	float eHealthClass::getTemperature(void)
	{	
		//Local variables
		float Temperature; //Corporal Temperature 
		float Resistance;  //Resistance of sensor.
		float ganancia=5.0;
		float Vcc=3.3;
		float RefTension=3.0; // Voltage Reference of Wheatstone bridge.
		float Ra=4700.0; //Wheatstone bridge resistance.
		float Rc=4700.0; //Wheatstone bridge resistance.
		float Rb=821.0; //Wheatstone bridge resistance.
		int sensorValue = analogRead(A3);
		
		float voltage2=((float)sensorValue*Vcc)/1023; // binary to voltage conversion  

		// Wheatstone bridge output voltage.
		voltage2=voltage2/ganancia;
		// Resistance sensor calculate  
		float aux=(voltage2/RefTension)+Rb/(Rb+Ra);
		Resistance=Rc*aux/(1-aux);    
		if (Resistance >=1822.8) {
			// if temperature between 25ºC and 29.9ºC. R(tª)=6638.20457*(0.95768)^t
			Temperature=log(Resistance/6638.20457)/log(0.95768);  
		} else {
			if (Resistance >=1477.1){
					// if temperature between 30ºC and 34.9ºC. R(tª)=6403.49306*(0.95883)^t
					Temperature=log(Resistance/6403.49306)/log(0.95883);  
			} else {
				if (Resistance >=1204.8){
					// if temperature between 35ºC and 39.9ºC. R(tª)=6118.01620*(0.96008)^t
					Temperature=log(Resistance/6118.01620)/log(0.96008); 
				}
				else{
					if (Resistance >=988.1){
						// if temperature between 40ºC and 44.9ºC. R(tª)=5859.06368*(0.96112)^t
						Temperature=log(Resistance/5859.06368)/log(0.96112); 
					}
					else {
						if (Resistance >=811.7){
							// if temperature between 45ºC and 50ºC. R(tª)=5575.94572*(0.96218)^t
							Temperature=log(Resistance/5575.94572)/log(0.96218); 
						}
					}
				}
			}  
		}
		
		return Temperature;
	}

	//!******************************************************************************
	//!		Name:	getOxygenSaturation()											*
	//!		Description: Returns the oxygen saturation in blood in percent.			*
	//!		Param : void															*
	//!		Returns: int with the oxygen saturation value							*
	//!		Example: int SPO2 = eHealth.getOxygenSaturation();						*
	//!******************************************************************************

	int eHealthClass::getOxygenSaturation(void)
	{
		return SPO2;
	}

	//!******************************************************************************
	//!		Name:	getBPM()														*
	//!		Description: Returns the heart beats per minute.						*
	//!		Param : void															*
	//!		Returns: int with the beats per minute									*
	//!		Example: int BPM = eHealth.getBPM();									*
	//!******************************************************************************

	int eHealthClass::getBPM(void)
	{
		return BPM;
	}


	//!******************************************************************************
	//!		Name:	getSkinConductance()											*
	//!		Description: Returns the value of skin conductance.						*
	//!		Param : void															*
	//!		Returns: float with the value of skin conductance						*
	//!		Example: float conductance = eHealth.getSkinConductance();				*
	//!******************************************************************************

	float eHealthClass::getSkinConductance(void)
	{
		// Local variable declaration.   
		float resistance;
		float conductance;
		delay(1);
		
		// Read an analogic value from analogic2 pin.
		float sensorValue = analogRead(A2);
		float voltage = sensorValue*5.0/1023;

		conductance = 2*((voltage - 0.5) / 100000);

		// Conductance calculation
		resistance = 1 / conductance; 
		conductance = conductance * 1000000;
		delay(1);
		
		if (conductance > 1.0) 	return conductance;
		else return -1.0;
	}


	//!******************************************************************************
	//!		Name:	getSkinResistance()												*
	//!		Description: Returns the value of skin resistance.						*
	//!		Param : void															*
	//!		Returns: float with the value of skin resistance						*
	//!		Example: float resistance = eHealth.getSkinResistance();				*
	//!******************************************************************************

	float eHealthClass::getSkinResistance(void)
	{	
		// Local variable declaration.   
		float resistance;
		float conductance;
	
		// Read an analogic value from analogic2 pin.
		float sensorValue = analogRead(A2);
		float voltage = (sensorValue * 5.0) / 1023; 
	
		delay(2);
		conductance = 2*((voltage - 0.5) / 100000);
   
		//Conductance calcultacion
		resistance = 1 / conductance;
		delay(2);
	
		if (resistance > 1.0 ) return resistance;
		else return -1.0;
	}

	
	//!******************************************************************************
	//!		Name:	getSkinConductanceVoltage()										*
	//!		Description: Returns the skin conductance value in voltage .			*
	//!		Param : void															*
	//!		Returns: float with the skin conductance value in voltage 				*
	//!		Example: float volt = eHealth.getSkinConductanceVoltage();				*
	//!******************************************************************************

	float eHealthClass::getSkinConductanceVoltage(void)
	{
		delay(2);
	
		//Read analogic value from analogic2 pin.
		int sensorValue = analogRead(A2);
	
		//Convert the readed value to voltage.
		float voltage = ( sensorValue * 5.0 ) / 1023;

		delay(2);
		return voltage;
	}


	//!******************************************************************************
	//!		Name:	getECG()														*
	//!		Description: Returns an analogic value to represent the ECG.			*
	//!		Param : void															*
	//!		Returns: float with the ECG value in voltage			 				*
	//!		Example: float volt = eHealth.getECG();									*
	//!******************************************************************************

	float eHealthClass::getECG(void)
	{
		float analog0;
		// Read from analogic in. 
		analog0=analogRead(0);
		// binary to voltage conversion
		return analog0 = (float)analog0 * 5 / 1023.0;   
	}
	

	//!******************************************************************************
	//!		Name:	getBodyPosition()												*
	//!		Description: Returns the current body position.							*
	//!		Param : void															*
	//!		Returns: uint8_t with the the position of the pacient.	 				*
	//!		Example: uint8_t position = eHealth.getBodyPosition();					*
	//!******************************************************************************

	uint8_t eHealthClass::getBodyPosition(void)
	{
		static byte source;

		/* If int1 goes high, all data registers have new data */
		if (digitalRead(int1Pin)) {// Interrupt pin, should probably attach to interrupt function	
			readRegisters(0x01, 6, &data[0]);  // Read the six data registers into data array.
			
			/* For loop to calculate 12-bit ADC and g value for each axis */
			for (int i=0; i<6; i+=2) {
				accelCount[i/2] = ((data[i] << 8) | data[i+1]) >> 4;  // Turn the MSB and LSB into a 12-bit value
				
					if (data[i] > 0x7F) {
						accelCount[i/2] = ~accelCount[i/2] + 1;
						accelCount[i/2] *= -1;  // Transform into negative 2's complement #
					}
					
				accel[i/2] = (float) accelCount[i/2]/((1<<12)/(2*scale));  // get actual g value, this depends on scale being set
			}		
		}
		
		/* If int2 goes high, either p/l has changed or there's been a single/double tap */
		if (digitalRead(int2Pin)) {
			source = readRegister(0x0C);  // Read the interrupt source reg.
			
			if ((source & 0x10)==0x10)  // If the p/l bit is set, go check those registers
				portraitLandscapeHandler();      

			delay(50); // Delay here for a little printing visibility, make it longer, or delete it
		}

		delay(100);
  
		return bodyPos; 
	}


	//!******************************************************************************
	//!		Name:	getSystolicPressure()											*
	//!		Description: Returns the  value of the systolic pressure.				*
	//!		Param : void															*
	//!		Returns: int with the systolic pressure.								*
	//!		Example: int systolic = eHealth.getSystolicPressure();					*
	//!******************************************************************************

	int eHealthClass::getSystolicPressure(void)
	{
		return systolic;
	}


	//!******************************************************************************
	//!		Name:	getDiastolicPressure()											*
	//!		Description: Returns the  value of the diastolic pressure.				*
	//!		Param : void															*
	//!		Returns: int with the diastolic pressure.								*
	//!		Example: int diastolic = eHealth.getDiastolicPressure();				*
	//!******************************************************************************

	int eHealthClass::getDiastolicPressure(void)
	{
		return diastolic;
	}


	//!******************************************************************************
	//!		Name:	getAirFlow()													*
	//!		Description: Returns an analogic value to represent the air flow.		*
	//!		Param : void															*
	//!		Returns: int with the airFlow value (0-1023).							*
	//!		Example: int airFlow = eHealth.getAirFlow();							*
	//!******************************************************************************

	int eHealthClass::getAirFlow(void)
	{
		int airFlow = analogRead(A1);

		
		return airFlow; 
	}


	//!******************************************************************************
	//!		Name:	printPosition()													*
	//!		Description: Returns an analogic value to represent the air flow.		*
	//!		Param : uint8_t position : the current body position. 					*
	//!		Returns: void															*
	//!		Example: eHealth.printPosition(position);								*
	//!******************************************************************************

	void eHealthClass::printPosition( uint8_t position )
	{
		if (position == 1) {
			Serial.println("Supine position");    
		} else if (position == 2) {
			Serial.println("Left lateral decubitus");
		} else if (position == 3) {
			Serial.println("Rigth lateral decubitus");
		} else if (position == 4) {
			Serial.println("Prone position");
		} else if (position == 5) {
			Serial.println("Stand or sit position");
		} else  {
			Serial.println("non-defined position");
		}
	}

	
	//!******************************************************************************
	//!		Name:	readPulsioximeter()												*
	//!		Description: It reads a value from pulsioximeter sensor.				*
	//!		Param : void										 					*
	//!		Returns: void															*
	//!		Example: readPulsioximeter();											*
	//!******************************************************************************
 
	void eHealthClass::readPulsioximeter(void)
	{
		uint8_t digito[] = {0,0,0,0,0,0};

		uint8_t A = 0;
		uint8_t B = 0;
		uint8_t C = 0;
		uint8_t D = 0;
		uint8_t E = 0;
		uint8_t F = 0;
		uint8_t G = 0;

		for (int i = 0; i<6 ; i++) { // read all the led's of the module
			A = !digitalRead(13);
			B = !digitalRead(12);
			C = !digitalRead(11);
			D = !digitalRead(10);
			E = !digitalRead(9);
			F = !digitalRead(8);
			G = !digitalRead(7);
			
			digito[i] = segToNumber(A, B, C ,D ,E, F,G);    
			delayMicroseconds(2800); //2800 microseconds
		}

			SPO2 = 10 * digito[5] + digito[4];
			BPM  = 100 * digito[2] + 10 * digito[1] + digito[0];
	}
	

	//!******************************************************************************
	//!		Name: airflowWave()														*
	//!		Description: It prints air flow wave form in the serial monitor			*
	//!		Param : int air with the analogic value									*
	//!		Returns: void															*
	//!		Example: eHealth.airflowWave();											*
	//!******************************************************************************

	void eHealthClass::airFlowWave(int air)
	{
		for (int i=0; i < (air / 5) ; i ++) {  
				Serial.print("..");  
		}

		Serial.print("..");
		Serial.print("\n");
		delay(25);
	}


	//!******************************************************************************
	//!		Name: readGlucometer()													*
	//!		Description: It reads the data stored in the glucometer					*
	//!		Param : void															*
	//!		Returns: void															*
	//!		Example: eHealth.readGlucometer();										*
	//!******************************************************************************
	
	void eHealthClass::readGlucometer(void)
	{
		delay(100);
		Serial.begin(1200);
		delay(100);

		Serial.print("U"); // Start communication command. 
		delay(1000); // Wait while receiving data.

		Serial.print("\n"); 
		if (Serial.available() > 0) {
			length = Serial.read();// The protocol sends the number of measures 
			Serial.read(); // Read one dummy data

			for (int i = 0; i<length; i++) { // The protocol sends data in this order 
				glucoseDataVector[i].year = Serial.read(); 
				glucoseDataVector[i].month = Serial.read();
				glucoseDataVector[i].day = Serial.read();
				glucoseDataVector[i].hour = Serial.read();
				glucoseDataVector[i].minutes = Serial.read();

				Serial.read(); // Byte of separation must be 0x00.

				glucoseDataVector[i].glucose = Serial.read();
				glucoseDataVector[i].meridian = Serial.read();

				Serial.read(); // CheckSum 1
				Serial.read(); // CheckSum 2			
			}
		}
	}

	//!******************************************************************************
	//!		Name: getGlucometerLength()												*
	//!		Description: it returns the number of data stored in the glucometer		*
	//!		Param : void															*
	//!		Returns: uint8_t with length											*
	//!		Example: int length = eHealth.getGlucometerLength();					*
	//!******************************************************************************

	uint8_t eHealthClass::getGlucometerLength(void)
	{
		return length;
	}

	//!******************************************************************************
	//!		Name: numberToMonth()													*
	//!		Description: Convert month variable from numeric to character.			*
	//!		Param : int month in numerical format									*
	//!		Returns: String with the month characters (January, February...).		*
	//!		Example: Serial.print(eHealth.numberToMonth(month));					*
	//!******************************************************************************
	
	String eHealthClass::numberToMonth(int month)
	{
		if (month == 1)  return "January"; 
		else if (month == 2)  return "February";
		else if (month == 3)  return "March";
		else if (month == 4)  return "April";
		else if (month == 5)  return "May";
		else if (month == 6)  return "June";
		else if (month == 7)  return "July";
		else if (month == 8)  return "August";
		else if (month == 9)  return "September";
		else if (month == 10) return "October";
		else if (month == 11) return "November";
		else return "December";
	}

	
	//!******************************************************************************
	//!		Name:	version()														*
	//!		Description: It check the version of the library						*
	//!		Param : void															*
	//!		Returns: void															*
	//!		Example: eHealth.version();												*
	//!******************************************************************************

	int eHealthClass::version(void)
	{
		return 1;
	}


//***************************************************************
// Private Methods												*
//***************************************************************

	//! This function will read the p/l source register and
	//!	print what direction the sensor is now facing */
	
	void eHealthClass::portraitLandscapeHandler()
	{
		byte pl = readRegister(0x10);  // Reads the PL_STATUS register
		
		switch((pl&0x06)>>1)  // Check on the LAPO[1:0] bits
		{
			case 0:
				position[0] = 0;
			break;
			
			case 1:
				position[0] = 1;
			break;
			
			case 2:
				position[0] = 2;
			break;
			
			case 3:
				position[0] = 3;
			break;
		}
		
		if (pl&0x01)  // Check the BAFRO bit
			position[1] = 0;
		else
			position[1] = 1;
		if (pl&0x40)  // Check the LO bit
			position[2] = 0;
		else 
			position[2] = 1;
 
		bodyPosition();  
	}

/*******************************************************************************************************/

	//! Initialize the MMA8452 registers.

	void eHealthClass::initMMA8452(byte fsr, byte dataRate)
	{
		MMA8452Standby();  // Must be in standby to change registers
  
		/* Set up the full scale range to 2, 4, or 8g. */
		if ((fsr==2)||(fsr==4)||(fsr==8))
			writeRegister(0x0E, fsr >> 2);  
		else
			writeRegister(0x0E, 0);
			
		/* Setup the 3 data rate bits, from 0 to 7 */
		writeRegister(0x2A, readRegister(0x2A) & ~(0x38));
		
		if (dataRate <= 7)
			writeRegister(0x2A, readRegister(0x2A) | (dataRate << 3));
			
		/* Set up portrait/landscap registers */
		writeRegister(0x11, 0x40);  // Enable P/L
		writeRegister(0x13, 0x14);  // 29deg z-lock, 
		writeRegister(0x14, 0x84);  // 45deg thresh, 14deg hyst
		writeRegister(0x12, 0x05);  // debounce counter at 100ms
		
		/* Set up single and double tap */
		writeRegister(0x21, 0x7F);  // enable single/double taps on all axes
		writeRegister(0x23, 0x20);  // x thresh at 2g
		writeRegister(0x24, 0x20);  // y thresh at 2g
		writeRegister(0x25, 0x8);  // z thresh at .5g
		writeRegister(0x26, 0x30);  // 60ms time limit, the min/max here is very dependent on output data rate
		writeRegister(0x27, 0x28);  // 200ms between taps min
		writeRegister(0x28, 0xFF);  // 1.275s (max value) between taps max
		
		/* Set up interrupt 1 and 2 */
		writeRegister(0x2C, 0x02);  // Active high, push-pull
		writeRegister(0x2D, 0x19);  // DRDY int enabled, P/L enabled
		writeRegister(0x2E, 0x01);  // DRDY on INT1, P/L on INT2
		
		MMA8452Active();  // Set to active to start reading
	}

/*******************************************************************************************************/

	//! Sets the MMA8452 to standby mode. It must be in standby to change most register settings.
	
	void eHealthClass::MMA8452Standby()
	{
		byte c = readRegister(0x2A);
		writeRegister(0x2A, c & ~(0x01));
	}

/*******************************************************************************************************/

	//! Sets the MMA8452 to active mode. Needs to be in this mode to output data
	
	void eHealthClass::MMA8452Active()
	{
		byte c = readRegister(0x2A);
		writeRegister(0x2A, c | 0x01);
	}

/*******************************************************************************************************/	

	//! Read i registers sequentially, starting at address into the dest byte array.
	void eHealthClass::readRegisters(byte address, int i, byte * dest)
	{
		i2cSendStart();
		i2cWaitForComplete();
		
		i2cSendByte((MMA8452_ADDRESS<<1));	// write 0xB4
		i2cWaitForComplete();
		
		i2cSendByte(address);	// write register address
		i2cWaitForComplete();
		
		i2cSendStart();
		i2cSendByte((MMA8452_ADDRESS<<1)|0x01);	// write 0xB5
		i2cWaitForComplete();
		
		for (int j=0; j<i; j++) {
			i2cReceiveByte(TRUE);
			i2cWaitForComplete();
			dest[j] = i2cGetReceivedByte();	// Get MSB result
		}
		
		i2cWaitForComplete();
		i2cSendStop();
		
		cbi(TWCR, TWEN);// Disable TWI
		sbi(TWCR, TWEN);// Enable TWI
	}

/*******************************************************************************************************/

	//! Read a single byte from address and return it as a byte.
	
	byte eHealthClass::readRegister(uint8_t address)
	{
		byte data;
		
		i2cSendStart();
		i2cWaitForComplete();
		
		i2cSendByte((MMA8452_ADDRESS<<1));	// write 0xB4
		i2cWaitForComplete();
		
		i2cSendByte(address);	// write register address
		i2cWaitForComplete();
		
		i2cSendStart();
		
		i2cSendByte((MMA8452_ADDRESS<<1)|0x01);	// write 0xB5
		i2cWaitForComplete();
		i2cReceiveByte(TRUE);
		i2cWaitForComplete();
		
		data = i2cGetReceivedByte();	// Get MSB result
		i2cWaitForComplete();
		i2cSendStop();
		
		cbi(TWCR, TWEN);	// Disable TWI
		sbi(TWCR, TWEN);	// Enable TWI
		
		return data;
	}

/*******************************************************************************************************/

	//! Writes a single byte (data) into address 
	void eHealthClass::writeRegister(unsigned char address, unsigned char data)
	{
		i2cSendStart();
		i2cWaitForComplete();  
		i2cSendByte((MMA8452_ADDRESS<<1));// write 0xB4
		i2cWaitForComplete();  
		i2cSendByte(address);// write register address
		i2cWaitForComplete();  
		i2cSendByte(data);
		i2cWaitForComplete();  
		i2cSendStop();
	}

/*******************************************************************************************************/

	//! Assigns a value depending on body position.

	void eHealthClass::bodyPosition( void )
	{  
		if (( position[0] == 0 ) && (position[1] == 1) && (position [2] == 0)) {
			bodyPos = 1;
		} else if (( position[0] == 1 ) && (position[1] == 1) && (position [2] == 0)) {
			bodyPos = 1;
		} else if (( position[0] == 3 ) && (position[1] == 1) && (position [2] == 0)) {
			bodyPos = 1;
		} else if (( position[0] == 2 ) && (position[1] == 0) && (position [2] == 0)) {
			bodyPos = 1;
		} else if (( position[0] == 2 ) && (position[1] == 1) && (position [2] == 1)) {
			bodyPos = 1;
		} else if (( position[0] == 2 ) && (position[1] == 1) && (position [2] == 0)) {
			bodyPos = 1; 
			
		} else if (( position[0] == 0 ) && (position[1] == 1) && (position [2] == 1)) {
			bodyPos = 2;
		} else if (( position[0] == 0 ) && (position[1] == 0) && (position [2] == 1)) {
			bodyPos = 2;
			
		} else if (( position[0] == 1 ) && (position[1] == 1) && (position [2] == 1)) {
			bodyPos = 3;
		} else if (( position[0] == 1 ) && (position[1] == 0) && (position [2] == 1)) {
			bodyPos = 3;
		  
		} else if (( position[0] == 1 ) && (position[1] == 0) && (position [2] == 0)) {
			bodyPos = 4;
		} else if (( position[0] == 3 ) && (position[1] == 0) && (position [2] == 0)) {
			bodyPos = 4;
			
		} else if (( position[0] == 3 ) && (position[1] == 0) && (position [2] == 1)) {
			bodyPos = 5;
		} else if (( position[0] == 3 ) && (position[1] == 1) && (position [2] == 1)) {
			bodyPos = 5;
		} else if (( position[0] == 2 ) && (position[1] == 0) && (position [2] == 1)) {
			bodyPos = 5;
		} else  { 
			bodyPos = 6;
		}
	}

/*******************************************************************************************************/

	//! Converts from 7 segments to number.

	uint8_t eHealthClass::segToNumber(uint8_t A, uint8_t B, uint8_t C, uint8_t D, uint8_t E, uint8_t F, uint8_t G )
	{
		if ((A == 1) && (B == 1) && (C == 1) && (D == 0) && (E == 1) && (F == 1) && (G == 1)) {
			return 0;
	   
		} else if ((A == 0) && (B == 1) && (C == 0) && (D == 0) && (E == 1) && (F == 0) && (G == 0)) {  
			return 1;
		
		} else if ((A == 1) && (B == 1) && (C == 0) && (D == 1) && (E == 0) && (F == 1) && (G == 1)) { 
			return 2;
		
		} else if ((A == 1) && (B == 1) && (C == 0) && (D == 1) && (E == 1) && (F == 0) && (G == 1)) { 
			return 3;
		
		} else if ((A == 0) && (B == 1) && (C == 1) && (D == 1) && (E == 1) && (F == 0) && (G == 0)) { 
			return 4;
		
		} else if ((A == 1) && (B == 0) && (C == 1) && (D == 1) && (E == 1) && (F == 0) && (G == 1)) { 
			return 5;
		
		} else if ((A == 1) && (B == 0) && (C == 1) && (D == 1) && (E == 1) && (F == 1) && (G == 1)) { 
			return 6;
		
		} else if ((A == 1) && (B == 1) && (C == 0) && (D == 0) && (E == 1) && (F == 0) && (G == 0)) {
			return 7;  
		
		} else if ((A == 1) && (B == 1) && (C == 1) && (D == 1) && (E == 1) && (F == 1) && (G == 1)) { 
			return 8;
		
		} else if ((A == 1) && (B == 1) && (C == 1) && (D == 1) && (E == 1) && (F == 0) && (G == 1)) { 
			return 9;
			
		} else  {
			return 0;
		}
	}

/*******************************************************************************************************/

//***************************************************************
// Preinstantiate Objects										*
//***************************************************************

	eHealthClass eHealth = eHealthClass();



and about the main code of arduino is the same

That's no reason to delete they line where the global eHealth variable is declared. The problem is that 'flexible arrays are tricky and seem to have fallen from favor in C++ (apparently this library is from 2012). You need to actually define the array's size in eHealth.h:

		//! Stores the body position in vector value. 
		uint8_t position[];

I don't have time to analyze the code, but a quick look in eHealth.cpp reveals that (private) variable is only accessed with indexes 0-2. So start with this and see what happens:

		//! Stores the body position in vector value. 
		uint8_t position[3];
1 Like

well thank you very much it has been solved but it appeared to me another error after compiling
the error message

Arduino: 1.8.19 (Windows 7), Board: "Arduino Yún"

In file included from C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp:33:0:

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.h:149:15: error: 'prog_uint8_t' has not been declared

      PROGMEM  prog_uint8_t *array);

               ^~~~~~~~~~~~

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp:41:11: error: 'prog_uint8_t' does not name a type; did you mean 'uint8_t'?

  PROGMEM  prog_uint8_t eHealthLogo[] = {

           ^~~~~~~~~~~~

           uint8_t

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp:109:10: error: 'prog_uint8_t' does not name a type; did you mean 'uint8_t'?

 PROGMEM  prog_uint8_t cookingLogo[] = {

          ^~~~~~~~~~~~

          uint8_t

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp: In member function 'void eHealthDisplayClass::init()':

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp:201:21: error: 'eHealthLogo' was not declared in this scope

   image(0,64,128,64,eHealthLogo);

                     ^~~~~~~~~~~

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp:201:21: note: suggested alternative: 'eHealth'

   image(0,64,128,64,eHealthLogo);

                     ^~~~~~~~~~~

                     eHealth

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp:209:21: error: 'cookingLogo' was not declared in this scope

   image(0,64,128,64,cookingLogo); delay(3000);

                     ^~~~~~~~~~~

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp: At global scope:

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp:663:20: error: 'prog_uint8_t' has not been declared

           PROGMEM  prog_uint8_t *array)

                    ^~~~~~~~~~~~

exit status 1

Error compiling for board Arduino Yún.

Error downloading https://espressif.github.io/arduino-esp32/package_esp32_index.json

Error downloading https://downloads.arduino.cc/packages/package_index.json


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

the eHealthDisplay.h

/*
 *  eHealth sensor platform for Arduino and Raspberry from Cooking-hacks.
 *
 *  Description: "The e-Health Sensor Shield allows Arduino and Raspberry Pi 
 *  users to perform biometric and medical applications by using 9 different 
 *  sensors: Pulse and Oxygen in Blood Sensor (SPO2), Airflow Sensor (Breathing),
 *  Body Temperature, Electrocardiogram Sensor (ECG), Glucometer, Galvanic Skin
 *  Response Sensor (GSR - Sweating), Blood Pressure (Sphygmomanometer) and 
 *  Patient Position (Accelerometer)."
 * 
 *  Copyright (C) 2012 Libelium Comunicaciones Distribuidas S.L.
 *  http://www.libelium.com
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Version 0.1
 *  Author: Luis Martín & Ahmad Saad
 */


// ensure this library description is only included once
#ifndef eHealthClassDisplay_h
#define eHealthClassDisplay_h

#include "Arduino.h"
#include <avr/pgmspace.h> 

// Library interface description
class eHealthDisplayClass {
   
   public: 
  
//***************************************************************
// Constructor of the class                              *
//***************************************************************
  
      //! Class constructor.
      eHealthDisplayClass(void);
       
//***************************************************************
// Public Methods                                    *
//***************************************************************

      //! Configure and initializes the LCD.
      /*!
      \param void
      \return void
      */   void init(void);

      //! Configure some parameters of the values screen. 
      /*!
      \param void
      \return void
      */   void initValuesScreen();

      //! It prints (refresh) the values of the sensors in the screen. 
      /*!
      \param void
      \return void
      */   void printValuesScreen();

      //! Configure some parameters of the ECG screen. 
      /*!
      \param void
      \return void
      */   void initECGScreen(void);

      //! It prints (refresh) the ECG wave in the LCD screen.
      /*!
      \param void
      \return void
      */   void printECGScreen(void);
      
      //! Configure some parameters of the AirFlow screen. 
      /*!
      \param void
      \return void
      */   void initAirFlowScreen();
      
      //! It prints (refresh) the AirFlow wave in the LCD screen.
      /*!
      \param void
      \return void
      */   void printAirFlowScreen(void);


//***************************************************************
// Private Methods                                    *
//***************************************************************

   private:

      //! Clear all data writed in the LCD. 
      void clearLCD(void);

      //! It writes data in decimal format. 
      void writeLcdDec(int data);

      //! It prints data in the LCD.
      void writeLCD(char *data);

      //! It prints a back space in the LCD. 
      void backspace();

      /*! It changes the baud rate uart communication with the LCD. 
         "1" =  4.800bps "2" =  96,00bps
         "3" = 19,200bps "4" =  38,400bps 
         "5" = 57,600bps "6" = 115,200bps
      */
      void changeBaudrate(char frec);

      //! It places the write pointer in the x-y position.  
      void coordinates(int x, int y);

      //! It activates or deactivates a pixel.  
      void pixel (int x, int y, int onOff);
      
      //! It draws or erases a line. 
      void line (int fromX, int fromY, int toX, int toY, int onOff);

      //! It draws or erases a circule. 
      void circle  (int x, int y, int radio, int onOff);

      //! It draws or erases a rectangle. 
      void rectangle (int fromX, int fromY,
                  int toX,
                  int toY,
                  int onOff);

      //! It clears an area of the LCD. 
      void clearSpace (int fromX, int fromY, int toX, int toY);

      //! It draws an image stored in an array. 
      void image (int desde_x,
               int desde_y,
               int ancho,
               int alto,
               PROGMEM  prog_uint8_t *array);

      //! It prints a lung in the AirFlow screen. 
      void printLung(uint8_t onOff);

      //!It prints the apnea advise.
      void apneaAdvise(uint8_t onOff);

      //! It prints a heart in the LCD.
      void printHeart(uint8_t onOff);

      //! It prints a guy in stand/sit position.  
      void standPosition();

      //! It prints a guy in rigth lateral position.
      void rigthLateralPosition();

      //! It prints a guy in letf lateral position.  
      void leftLateralPosition();

      //! It prints a guy in supine position.
      void supinePosition();

      //! It prints a guy in prone position.
      void pronePosition();

//***************************************************************
// Private Variables                                 *
//***************************************************************

      //! It stores the number of breaths or beats. 
      int count;

      //! It stores the current value of the ECG or AirFlow sensor. 
      int valRead;

      //! It stores the previous value of the ECG or AirFlow sensor. 
      int prevRead;

      //! Number of counts per minute. It stores the number of
      //! breaths in air flow, and the number of beats in ECG.
      int  countsPerMinute;

      //! The previous value of time. 
      long timePrevious;

      //! It stores the time when the last measure was taked.
      long timePreviousMeassure;

      //! The current time. 
      long time;
      
      //! Previous value of count variable. 
      long countPrevious ;

      //! Vairable who indicates the current state of the wave.
      uint8_t waveState;

      //! It stores the current value of x position in the LCD.
      uint8_t x;

      //! It stores the current value of y position in the LCD.
      uint8_t y;

      //! Auxiliar variable.
      int z;

      //! Auxiliar variable.
      int q;

      //! Auxiliar variable.
      int a;

      //! The final size of the image. 
      int final;

      //! An auxiliar variable.
      unsigned char temp;

      //! It stores the current body position. 
      uint8_t bodyPosition;

      //! It stores the current blood oxygen saturation. 
      uint8_t oxygen;

      //! It stores the current value of pulse.
      uint8_t pulse; 
};

extern eHealthDisplayClass eHealthDisplay;

#endif

and the eHealthDisplay.cpp

/*
 *  eHealth sensor platform for Arduino and Raspberry from Cooking-hacks.
 *
 *  Description: "The e-Health Sensor Shield allows Arduino and Raspberry Pi 
 *  users to perform biometric and medical applications by using 9 different 
 *  sensors: Pulse and Oxygen in Blood Sensor (SPO2), Airflow Sensor (Breathing),
 *  Body Temperature, Electrocardiogram Sensor (ECG), Glucometer, Galvanic Skin
 *  Response Sensor (GSR - Sweating), Blood Pressure (Sphygmomanometer) and 
 *  Patient Position (Accelerometer)."
 *
 *  Copyright (C) 2012 Libelium Comunicaciones Distribuidas S.L.
 *  http://www.libelium.com
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Version 0.1
 *  Author: Luis Martín & Ahmad Saad
 */


// include this library's description file
#include "eHealthDisplay.h"
#ifndef eHealth_h
	#include "eHealth.h"
#endif

#define pushButton 4

//LOGO EHEALTH
	PROGMEM  prog_uint8_t eHealthLogo[] = {
	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, 0x07, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x1F, 0x00, 0x3C, 0x00, 0x78, 0x0F, 0x0E, 0x18, 0x0F, 0xC0, 0x0F, 0xC0, 0x00, 0x00,
	0x00, 0x00, 0x7F, 0xC0, 0xFE, 0x01, 0xFE, 0x0F, 0x1F, 0x3C, 0x1F, 0xF0, 0x1F, 0xE0, 0x00, 0x00,
	0x00, 0x00, 0xFF, 0xC1, 0xFF, 0x83, 0xFF, 0x0F, 0x3E, 0x3C, 0x3F, 0xF0, 0x3F, 0xF0, 0x00, 0x00,
	0x00, 0x01, 0xFF, 0xE3, 0xFF, 0x87, 0xFF, 0x8F, 0xFE, 0x3C, 0x7F, 0xF8, 0x7F, 0xF8, 0x00, 0x00,
	0x00, 0x01, 0xE1, 0xC7, 0xC7, 0xC7, 0xC7, 0xCF, 0xFC, 0x3C, 0x78, 0x7C, 0x78, 0x78, 0x00, 0x00,
	0x00, 0x01, 0xE0, 0x07, 0x83, 0xC7, 0x83, 0xCF, 0xF8, 0x3C, 0xF0, 0x3C, 0xF0, 0x3C, 0x00, 0x00,
	0x00, 0x01, 0xC0, 0x07, 0x83, 0xCF, 0x03, 0xCF, 0xF0, 0x3C, 0xF0, 0x3C, 0xF0, 0x3C, 0x00, 0x00,
	0x00, 0x01, 0xE0, 0x07, 0x83, 0xC7, 0x03, 0xCF, 0xF0, 0x3C, 0xF0, 0x3C, 0xF0, 0x3C, 0x00, 0x00,
	0x00, 0x01, 0xE0, 0xC7, 0x83, 0xC7, 0x83, 0xCF, 0xFC, 0x3C, 0xF0, 0x3C, 0x78, 0x7C, 0x00, 0x00,
	0x00, 0x01, 0xFF, 0xC7, 0xC7, 0xC7, 0xC7, 0x8F, 0xFE, 0x3C, 0xF0, 0x3C, 0x7F, 0xF8, 0x00, 0x00,
	0x00, 0x00, 0xFF, 0xE3, 0xFF, 0x83, 0xFF, 0x8F, 0x3E, 0x3C, 0xF0, 0x3C, 0x7F, 0xF8, 0x00, 0x00,
	0x00, 0x00, 0x7F, 0xC1, 0xFF, 0x03, 0xFF, 0x0F, 0x1F, 0x3C, 0xF0, 0x3C, 0x3F, 0xFC, 0x00, 0x00,
	0x00, 0x00, 0x3F, 0x00, 0xFE, 0x00, 0xFE, 0x07, 0x0E, 0x38, 0x70, 0x38, 0x0F, 0xFC, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFC, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xF8, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF8, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x7F, 0xF0, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x60, 0x3E, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1F, 0xF8, 0x03, 0xF8, 0x03, 0xF0, 0x78, 0xF0, 0xFF, 0x80, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1F, 0xFC, 0x07, 0xFC, 0x0F, 0xFC, 0x79, 0xF1, 0xFF, 0x80, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1F, 0xFE, 0x0F, 0xFE, 0x0F, 0xFC, 0x7B, 0xF3, 0xFF, 0x80, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1F, 0xBF, 0x1F, 0x3E, 0x1F, 0x3C, 0x7F, 0xE3, 0xC0, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x0F, 0x1E, 0x0F, 0x1E, 0x08, 0x7F, 0xC3, 0xFE, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x0F, 0x3C, 0x0F, 0x3C, 0x00, 0x7F, 0x03, 0xFF, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x07, 0xBC, 0x0F, 0x3C, 0x00, 0x7F, 0x01, 0xFF, 0x80, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x07, 0x9E, 0x0F, 0x3C, 0x00, 0x7F, 0x80, 0xFF, 0xC0, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x07, 0x9E, 0x1F, 0x1E, 0x1C, 0x7F, 0xC0, 0x03, 0xC0, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x07, 0x9F, 0xFF, 0x1F, 0xFC, 0x7B, 0xE0, 0xFF, 0xC0, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x07, 0x8F, 0xFF, 0x0F, 0xFC, 0x79, 0xF1, 0xFF, 0x80, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x07, 0x07, 0xFF, 0x07, 0xF8, 0x78, 0xF1, 0xFF, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x0C, 0x07, 0x01, 0xE6, 0x01, 0xE0, 0x30, 0x60, 0xFE, 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, 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,
	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, 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, 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, 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
};

//Cooking-Hacks logo. 
PROGMEM  prog_uint8_t cookingLogo[] = {
	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, 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, 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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x01, 0x83, 0x00, 0x00, 0x00, 0x06, 0x0C, 0x00, 0xC0, 0x00, 0x00, 0x07, 0xF0, 0x00,
	0x00, 0x00, 0x03, 0xC7, 0x80, 0x00, 0x00, 0x0F, 0x1E, 0x01, 0xE0, 0x00, 0x00, 0x07, 0xF0, 0x00,
	0x00, 0x00, 0x03, 0xC7, 0x80, 0x00, 0x00, 0x0F, 0x1E, 0x01, 0xE0, 0x00, 0x00, 0x07, 0xF0, 0x00,
	0x00, 0x00, 0x03, 0xC7, 0x80, 0x00, 0x00, 0x0F, 0x1F, 0xE1, 0xE0, 0x00, 0x00, 0x07, 0xF0, 0x00,
	0x1F, 0xC0, 0x03, 0xC7, 0x8F, 0xE0, 0x7F, 0x0F, 0x1F, 0xF1, 0xFF, 0x00, 0x00, 0x07, 0xF0, 0x00,
	0x3F, 0xE0, 0x03, 0xC7, 0x9F, 0xF0, 0xFF, 0x8F, 0x1F, 0xF1, 0xFF, 0x80, 0x00, 0x07, 0xF0, 0x00,
	0x30, 0x70, 0x03, 0xFF, 0x98, 0x38, 0xFF, 0x8F, 0x1F, 0xE1, 0xFF, 0xC0, 0x00, 0x07, 0xF0, 0x00,
	0x70, 0x73, 0xF3, 0xFF, 0xB8, 0x39, 0xE3, 0xCF, 0x1E, 0x01, 0xFF, 0xC0, 0x00, 0x07, 0xF0, 0x00,
	0x7F, 0xF7, 0xFB, 0xFF, 0xBF, 0xF9, 0xC1, 0xCF, 0x1E, 0x01, 0xE3, 0xC0, 0x00, 0x07, 0xF0, 0x00,
	0x7F, 0xF3, 0xF3, 0xC7, 0xBF, 0xF9, 0xC1, 0xCF, 0x1E, 0x01, 0xE3, 0xC0, 0x00, 0x07, 0xF0, 0x00,
	0x7F, 0xE0, 0x03, 0xC7, 0xBF, 0xF1, 0xE3, 0xCF, 0x1F, 0x39, 0xE3, 0xC0, 0x00, 0x07, 0xF0, 0x00,
	0x30, 0x00, 0x03, 0xC7, 0x98, 0x00, 0xFF, 0xCF, 0x8F, 0xF9, 0xE3, 0xC0, 0x3F, 0xFF, 0xFF, 0xFE,
	0x3F, 0xC0, 0x03, 0xC7, 0x9F, 0xE0, 0xFF, 0xCF, 0xE7, 0xF9, 0xE3, 0xC0, 0x3F, 0xFF, 0xFF, 0xFE,
	0x1F, 0xC0, 0x03, 0xC7, 0x8F, 0xE0, 0x7E, 0xC7, 0xE3, 0xF0, 0xC1, 0x80, 0x3F, 0xFF, 0xFF, 0xFE,
	0x00, 0x00, 0x01, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFE,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFE,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFE,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFE,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xF0, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xF0, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xF0, 0x00,
	0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xE0, 0x00, 0x00, 0x00, 0x40, 0x00, 0x07, 0xF0, 0x00,
	0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x40, 0x00, 0x07, 0xF0, 0x00,
	0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x40, 0x00, 0x07, 0xF0, 0x00,
	0x20, 0x0F, 0xDF, 0x9F, 0x1F, 0x1C, 0x0F, 0xF1, 0xF1, 0xF1, 0xCF, 0xC0, 0x00, 0x07, 0xF0, 0x00,
	0x1F, 0x90, 0x50, 0xA0, 0x20, 0xA0, 0x08, 0x0A, 0x08, 0x0A, 0x10, 0x40, 0x00, 0x07, 0xF0, 0x00,
	0x00, 0x5F, 0xD0, 0x9F, 0x20, 0xA0, 0x08, 0x0A, 0x09, 0xFA, 0x10, 0x40, 0x00, 0x07, 0xF0, 0x00,
	0x00, 0x50, 0x10, 0x80, 0xA0, 0xA0, 0x08, 0x0A, 0x0A, 0x0A, 0x10, 0x40, 0x00, 0x07, 0xF0, 0x00,
	0x00, 0x50, 0x10, 0x80, 0xA0, 0xA0, 0x08, 0x0A, 0x0A, 0x0A, 0x10, 0x40, 0x00, 0x07, 0xF0, 0x00,
	0x3F, 0x8F, 0x90, 0x9F, 0x1F, 0x20, 0x0F, 0xF1, 0xF1, 0xF2, 0x0F, 0xC0, 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, 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,
	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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
//***************************************************************
// Constructor of the class										*
//***************************************************************

	eHealthDisplayClass::eHealthDisplayClass(void){/*void constructor*/}

//***************************************************************
// Public Methods												*
//***************************************************************

	//!******************************************************************
	//!	Name: init()													*
	//!	Description: Configure and initializes the LCD.					*
	//!	Param : void													*
	//!	Returns: void													*
	//!	Example: eHealthDisplay.init();									*
	//!******************************************************************
	
	void eHealthDisplayClass::init(void)
	{
		//Configure the eHealth push-Button
		pinMode(pushButton, INPUT);
		clearLCD();
		delay(2000);

		//It prints the eHealth logo. 
		image(0,64,128,64,eHealthLogo);

		coordinates(1, 15);
		writeLCD("www.cooking-hacks.com"); 	delay(4000);

		clearLCD();

		//It prints cooking hacks logo. 
		image(0,64,128,64,cookingLogo);	delay(3000); 
		clearLCD();  
		delay(500);
	}

	//!******************************************************************
	//!	Name: initValuesScreen()										*
	//!	Description: Configure some parameters of the values screen.	*
	//!	Param : void													*
	//!	Returns: void													*
	//!	Example: eHealthDisplay.initValuesScreen();						*
	//!******************************************************************
	
	void eHealthDisplayClass::initValuesScreen()
	{
		bodyPosition = 0;
		oxygen = 0;
		
		eHealth.initPositionSensor();	delay(50);
		eHealth.initPulsioximeter();	delay(50);
		clearLCD();		delay(50);
		
		coordinates(99, 60);	writeLCD("Pose");			delay(100);
		coordinates(1,60);		writeLCD("CURRENT DATA");	delay(100);
		coordinates(1, 47);		writeLCD("Pulse (bpm)");	delay(100);
		coordinates(1, 35);		writeLCD("Conductance");	delay(100);
		coordinates(1, 22);		writeLCD("Oxygen");			delay(100);
		coordinates(90, 22);	writeLCD("%");				delay(100);
		coordinates(1, 9);		writeLCD("Temperature");	delay(100);
		coordinates(105, 9);	writeLCD("C");				delay(100);
		
		pixel (103,9,1);	pixel (104,9,1);
		pixel (103,8,1);	pixel (104,8,1);
	}

	//!******************************************************************
	//!	Name:	printValuesScreen()										*
	//!	Description: Refresh the values of the sensors in the screen.	*
	//!	Param : void													*
	//!	Returns: void													*
	//!	Example: eHealthDisplay.printValuesScreen();					*
	//!******************************************************************
	
	void eHealthDisplayClass::printValuesScreen(void)
	{
		
		delay(100);

		//Prints the current value of diastolic pressure.
		if (pulse != eHealth.getBPM()) {
			pulse = eHealth.getBPM();
			clearSpace(70, 40, 90, 47);
			coordinates(70,47);	Serial.print(pulse);
			delay(10);
		}

		//Stores the current value of skin conductance. 
		float conductance = eHealth.getSkinConductance();
		delay(20);

		//If conductance == -1, the sensor is no connected. 
		if ( conductance == -1 ) {
			coordinates(70,35);	Serial.print(F("NOCN")); //No connected message. 
			delay(10);
		} 
		else {		
			coordinates(70,35);	Serial.print(conductance,2);
			delay(10);
		}

		if (oxygen != eHealth.getOxygenSaturation())
		{
			oxygen = eHealth.getOxygenSaturation();
			clearSpace(70, 15, 90, 22);
			coordinates(70, 22);	Serial.print(oxygen);
			delay(10);
		}

		//Prints the current value of temperature. 
		coordinates(70,9);	Serial.print(eHealth.getTemperature(),2);
		delay(10);

		//If no changes in position, don't refresh the screen. 
		if (bodyPosition != eHealth.getBodyPosition()) {

			bodyPosition = eHealth.getBodyPosition();
			clearSpace(95, 34, 117, 50); // Clear the previous position. 

				 if (bodyPosition == 1) supinePosition();
			else if (bodyPosition == 2) leftLateralPosition();
			else if (bodyPosition == 3) rigthLateralPosition();
			else if (bodyPosition == 5) standPosition();
			else pronePosition();
		}
				
		delay(10);
	}

	//!******************************************************************
	//!	Name:	initECGScreen()											*
	//!	Description: Configure some parameters of the ECG screen.		*
	//!	Param : void													*
	//!	Returns: void													*
	//!	Example: eHealthDisplay.initECGScreen();						*
	//!******************************************************************
	
	void eHealthDisplayClass::initECGScreen(void)
	{
		clearLCD();    
		delay(200);

		timePrevious = 0;
		timePreviousMeassure = 0;
		time = 0;
		countPrevious = 0;

		//ECG LOGO
		line(20, 49, 21, 49, 1); 	line(22, 49, 24, 55, 1);
		line(24, 55, 28, 45, 1);	line(28, 45, 29, 49, 1);
		line(29, 49, 32, 49, 1);	delay(100);        

		//LETRAS POR PANTALLA 
		coordinates(42, 52);	writeLCD("ECG");
		coordinates(100, 52);	writeLCD( "cpm"); 

		delay(150);
		timePreviousMeassure = millis();
		count = 0;
		printHeart(1);
		x = 8;
	}

	//!******************************************************************
	//!		Name:	printECGScreen()									*
	//!		Description: Refresh the ECG wave in the LCD screen.		*
	//!		Param : void												*
	//!		Returns: void												*
	//!		Example: eHealthDisplay.printECGScreen();					*
	//!******************************************************************
	
	void eHealthDisplayClass::printECGScreen(void)
	{
		
		for (int j=0; j<45; j++){
			pixel(8,j,0);
		}
		
		delay(20);

		if (millis()-timePreviousMeassure > 10000){
			countsPerMinute = 6*count;
			timePreviousMeassure = millis();
			count = 0;
			//Clear space
			coordinates(95, 52);	backspace();
			coordinates(90, 52);	backspace();
			coordinates(85, 52);	backspace();
			coordinates(80, 52);	backspace();
			writeLcdDec(countsPerMinute);
			delay(20);
		}

		delay(10);
		printHeart(1);

		// Input 1   
		valRead = map(analogRead(0), 0, 1023, 5, 45);
		pixel (x, valRead, 1);

		if(x>12){
			line(x-1, prevRead, x, valRead, 1);
		}

		//Hearth blink
		if(valRead> 30)
		{
			count=count+1;
			printHeart(0);
			delay(200);
		}

		//Wave refresh 
		for (int j = 5; j<45; j++){
			pixel(x+1,j,0);
		}

		//Previous value
		prevRead = valRead;
		x++; 		
		if (x == 120) x = 8;
	}

	//!******************************************************************
	//!	Name: initAirFlowScreen()										*
	//!	Description: Configure some parameters of the AirFlow screen.	*
	//!	Param : void													*
	//!	Returns: void													*
	//!	Example: eHealthDisplay.initAirFlowScreen();					*
	//!******************************************************************
	
	void eHealthDisplayClass::initAirFlowScreen()
	{
		clearLCD();
		delay(200);

		timePrevious = 0;
		timePreviousMeassure = 0;
		time = 0;
		countPrevious = 0;
		coordinates(53, 52);
		writeLCD( "bpm");

		printLung(1);	delay(200);
		
		timePreviousMeassure = millis();
		count = 0;

		x=8;
	}

	//!******************************************************************
	//!	Name: printAirFlowScreen()										*
	//!	Description: It prints the AirFlow wave in the LCD screen.		*
	//!	Param : void													*
	//!	Returns: void													*
	//!	Example: eHealthDisplay.printAirFlowScreen();					*
	//!******************************************************************
	
	void eHealthDisplayClass::printAirFlowScreen(void)
	{
		int j = 0;
		
		for (j=0; j<45; j++)
		{
			pixel(8, j, 0);
		}
		
		delay(10);   

		//Lung picture
		if (millis()-timePreviousMeassure > 10000) {
			countsPerMinute = 6*count;
			timePreviousMeassure = millis();
			//Apnea signal OFF

			apneaAdvise(0);

			coordinates(94, 52);	backspace();
			coordinates(99, 52);	backspace();
			coordinates(104, 52);	backspace();
			coordinates(109, 52);	backspace();
			coordinates(114, 52);	backspace();
			coordinates(119, 52);	backspace();
			coordinates(124, 52);	backspace();
			delay(10);  

			if(count ==0 ){
				//Apnea sinal ON
				apneaAdvise(1);

				coordinates(94, 52);
				writeLCD("Apnea");
				delay(5);
			}

			count = 0;
			//Clear the space
			coordinates(53, 52);	backspace();
			coordinates(50, 52);	backspace();
			coordinates(45, 52);	backspace();
			coordinates(40, 52);	backspace();

			writeLcdDec(countsPerMinute);
			delay(20);
		}

			//Lung ON
			printLung(1);

			// Input 1   
			valRead = analogRead(1);

			valRead   = map(valRead, 0, 1023, 5, 45);
			delay(100);
			pixel (x, valRead, 1);
     
			if(x>8){
				line(x-1, prevRead, x, valRead, 1);
			}

			if(valRead> 7)	waveState=1;
			

			if(waveState==1)
			{
				if(valRead<6)
				{
					//Lung OFF
					printLung(0);
					count=count+1;
					waveState=0;
					delay(100);
				}
			}

			//Wave refresh
			for (j = 5; j < 40 ; j++)
			{
				pixel(x+1,j,0);
			}

			prevRead = valRead;  

		x++;

		if (x == 120) x = 8;
	}

//***************************************************************
// Private Methods												*
//***************************************************************

	//! Clear all data writed in the LCD. 
	void eHealthDisplayClass::clearLCD()
	{
		Serial.print(char(0x7C));
		Serial.print(char(0x00));
		delay(20);
	}

	//! It writes data in decimal format.
	void eHealthDisplayClass::writeLcdDec(int data)
	{
		Serial.print(data,DEC);
		delay(20);
	}

	//! It prints data in the LCD.
	void eHealthDisplayClass::writeLCD(char *data){
	  Serial.print(data);
	  delay(20);
	}
	
	//! It prints a back space in the LCD.
	void eHealthDisplayClass::backspace()
	{
		Serial.print(char(0x08));
		delay(20);
	}

	/*! It changes the baud rate uart communication with the LCD. 
		"1" =  4.800bps "2" =  96,00bps
		"3" = 19,200bps "4" =  38,400bps 
		"5" = 57,600bps "6" = 115,200bps
	*/
	void eHealthDisplayClass::changeBaudrate(char frec)
	{								//"1" =  4.800bps "2" =  96,00bps
		Serial.print(char(0x7C));	//"3" = 19,200bps "4" =  38,400bps 
		Serial.print(char(0x07));	//"5" = 57,600bps "6" = 115,200bps
		Serial.print(char(frec)); 
		delay(20);
	}

	//! It places the write pointer in the x-y position.  
	void eHealthDisplayClass::coordinates(int x, int y)
	{									//x from 0 to 127
		Serial.print(char(0x7C));		//y from 0 to  63
		Serial.print(char(0x18));
		Serial.print(char(x));
		Serial.print(char(0x7C)); 
		Serial.print(char(0x19));
		Serial.print(char(y));
		delay(20);
	}

	//! It activates or deactivates a pixel. 
	void eHealthDisplayClass::pixel (int x, int y, int onOff)
	{									//x from 0 to 127 
		Serial.print(char(0x7C));		//y from 0 to  63
		Serial.print(char(0x10));		//on_off=1 ON
		Serial.print(char(x));			//on_off=0 Off
		Serial.print(char(y));
		Serial.print(char(onOff));
	}

	//!It draws or erases a line. 
	void eHealthDisplayClass::line (int fromX,
									int fromY,
									int toX,
									int toY,
									int onOff)
	{ 
		Serial.print(char(0x7C));
		Serial.print(char(0x0C));
		Serial.print(char(fromX));
		Serial.print(char(fromY));
		Serial.print(char(toX));
		Serial.print(char(toY));
		Serial.print(char(onOff));
		delay(20);
	}

	//! It draws or erases a circule. 
	void eHealthDisplayClass::eHealthDisplayClass::circle (	int x,
															int y,
															int radio,
															int onOff)
	{ 
		Serial.print(char(0x7C));             
		Serial.print(char(0x03));               
		Serial.print(char(x));
		Serial.print(char(y));
		Serial.print(char(radio));  
		Serial.print(char(onOff));
		delay(20);
	}

	//! It draws or erases a rectangle. 
	void eHealthDisplayClass::rectangle(int fromX,
										int fromY,
										int toX,
										int toY,
										int onOff)
	{ 
		Serial.print(char(0x7C));             
		Serial.print(char(0x0F));               
		Serial.print(char(fromX));
		Serial.print(char(fromY));
		Serial.print(char(toX));
		Serial.print(char(toY));  
		Serial.print(char(onOff));
		delay(20);
	}

	//! It clears an area of the LCD. 
	void eHealthDisplayClass::clearSpace (	int fromX,
											int fromY,
											int toX,
											int toY)
	{ 
		Serial.print(char(0x7C));
		Serial.print(char(0x05));
		Serial.print(char(fromX));
		Serial.print(char(fromY));
		Serial.print(char(toX));
		Serial.print(char(toY));  
		delay(20);
	}

	//! It draws an image stored in an array.
	void eHealthDisplayClass::image (	int desde_x,
										int desde_y,
										int ancho,
										int alto,
										PROGMEM  prog_uint8_t *array)
	{ 
		q=0;
		final=ancho+desde_x;
		y=alto-1; 
		for (a = 0; a <= alto ; a++)
		{
			for (x = desde_x; x < final ; x=x+8)   
			{       
				temp = pgm_read_word_near(array + q);
				for (z=x; z < (x+8); z++)
			{
				if (temp & 0x80)pixel(z,y,1);
				temp= temp<<1;
			} 
			q++;
			}
			y--;
		}
	}


	//! It prints a lung in the AirFlow screen. 
	void eHealthDisplayClass::printLung(uint8_t onOff)
	{
		pixel (10,50 , onOff);	pixel (10,49 , onOff);	pixel (10,48 , onOff);
		pixel (10,47 , onOff);	pixel (10,46 , onOff);	pixel (11,51 , onOff);
		pixel (11,46 , onOff);	pixel (12,52 , onOff);	pixel (12,46 , onOff);
		pixel (13,53 , onOff);	pixel (13,46 , onOff);	pixel (14,53 , onOff);
		pixel (14,52 , onOff);	pixel (14,51 , onOff);	pixel (14,50 , onOff);
		pixel (14,49 , onOff);	pixel (14,48 , onOff);	pixel (14,47 , onOff);
		pixel (14,46 , onOff);	pixel (15,50 , onOff);	pixel (16,51 , onOff);
		pixel (16,52 , onOff);	pixel (16,53 , onOff);	pixel (16,54 , onOff);
		pixel (16,55 , onOff);	pixel (16,56 , onOff);	pixel (17,50 , onOff);       
		pixel (13,51 , onOff);	pixel (19,51 , onOff);	pixel (13,49 , onOff);
		pixel (19,49 , onOff);	pixel (18,53 , onOff);	pixel (18,52 , onOff);
		pixel (18,51 , onOff);	pixel (18,50 , onOff);	pixel (18,49 , onOff);
		pixel (18,48 , onOff);	pixel (18,47 , onOff);	pixel (18,46 , onOff);
		pixel (19,53 , onOff);	pixel (19,46 , onOff);	pixel (20,52 , onOff);
		pixel (20,46 , onOff);	pixel (21,51 , onOff);	pixel (21,46 , onOff);
		pixel (22,50 , onOff);	pixel (22,49 , onOff);	pixel (22,48 , onOff);
		pixel (22,47 , onOff);	pixel (22,46 , onOff);
	}


	//!It prints the apnea advise.
	void eHealthDisplayClass::apneaAdvise(uint8_t onOff)
	{
		line(90, 41, 90, 56, onOff);	line(77, 41, 77, 56, onOff);
		line(77, 56, 90, 56, onOff);	line(77, 41, 90, 41, onOff);
		
		pixel (84,54,onOff);	pixel (84,53,onOff);	pixel (84,52,onOff);
		pixel (84,51,onOff);	pixel (84,50,onOff);	pixel (84,49,onOff);
		pixel (84,48,onOff);	pixel (84,47,onOff);	pixel (84,44,onOff);
		pixel (84,43,onOff);	pixel (83,54,onOff);	pixel (83,53,onOff);
		pixel (83,52,onOff);	pixel (83,51,onOff);	pixel (83,50,onOff);
		pixel (83,49,onOff);	pixel (83,48,onOff);	pixel (83,47,onOff);
		pixel (83,44,onOff);	pixel (83,43,onOff);
	}

	//! It prints a heart in the LCD.
	void eHealthDisplayClass::printHeart(uint8_t onOff)
	{
		pixel (10,50 , onOff);	pixel (11,51 , onOff);
		pixel (12,50 , onOff);	pixel (13,49 , onOff);
		pixel (14,50 , onOff);	pixel (15,51 , onOff);
		pixel (16,50 , onOff);	pixel (10,50 , onOff);    
		pixel (10,49 , onOff);	pixel (16,49 , onOff);
		pixel (11,48 , onOff);	pixel (15,48 , onOff);
		pixel (12,47 , onOff);	pixel (14,47 , onOff);
		pixel (13,46 , onOff);
	}

	//! It prints a guy in stand/sit position.  
	void eHealthDisplayClass::standPosition()
	{
		line(108,50,113,50,1);	line(107,49,114,49,1);
		line(107,48,108,48,1);	line(110,48,111,48,1);
		line(113,48,114,48,1);	line(107,47,114,47,1);
		line(107,46,114,46,1);	line(107,45,108,45,1);
		line(113,45,114,45,1);	line(107,44,114,44,1);
		line(108,43,113,43,1);	line(110,42,110,35,1);
	}

	//! It prints a guy in rigth lateral position.
	void eHealthDisplayClass::rigthLateralPosition()
	{
		line(100, 35, 100, 40, 1);	line(101, 34, 101, 41, 1);
		line(102, 34, 102, 35, 1);	line(102, 37, 102, 38, 1);
		line(102, 40, 102, 41, 1);	line(103, 34, 103, 41, 1);
		line(104, 34, 104, 41, 1);	line(105, 34, 105, 35, 1);
		line(105, 40, 105, 41, 1);	line(106 ,34, 106, 41, 1);
		line(107 ,35, 107, 40, 1);	line(108, 37, 115, 37,1);
	}

	//! It prints a guy in letf lateral position.  
	void eHealthDisplayClass::leftLateralPosition()
	{
		line(100, 35, 100, 40, 1);	line(101, 34, 101, 41, 1);
		line(102, 34, 102, 41, 1);	line(103, 34, 103, 41, 1);
		line(104, 34, 104, 41, 1);	line(105, 34, 105, 41, 1);
		line(106 ,34, 106, 41, 1);	line(107 ,35, 107, 40, 1);
		line(108, 37, 115, 37,1);
	}

	//! It prints a guy in supine position.
	void eHealthDisplayClass::supinePosition()
	{
		line(100, 35, 100, 40, 1);	line(101, 34, 101, 41, 1);
		line(102, 34, 102, 38, 1);	line(102, 40, 102, 41, 1);
		line(103, 34, 103, 41, 1);	line(104, 34, 104, 41, 1);
		line(105, 34, 105, 38, 1);	line(106 ,34, 106, 41, 1);
		line(107 ,35, 107, 40, 1);	line(107 ,37, 114, 37, 1);
	}

	//! It prints a guy in prone position.
	void eHealthDisplayClass::pronePosition()
	{
		line(100, 35, 100, 40, 1);	line(101, 34, 101, 41, 1);
		line(102, 34, 102, 35, 1);	line(102, 37, 102, 41, 1);
		line(103, 34, 103, 41, 1);	line(104, 34, 104, 41, 1);
		line(105, 38, 105, 41, 1);	line(106 ,34, 106, 41, 1);
		line(107 ,35, 107, 40, 1);	line(107 ,37, 114, 37, 1);
	}
	

//***************************************************************
// Preinstantiate Objects										*
//***************************************************************

	eHealthDisplayClass eHealthDisplay = eHealthDisplayClass();






eHealthDisplay.h has this line:

#include <avr/pgmspace.h>

Apparently the prog_uint8_t is defined in there. Does the Yun have a pgmspace.h file? Does it contain a definition of prog_uint8_t ?

It's unlikely I'll be able provide further help as I don't know anything about the Arduino Yun.

yes i change the board i'm trying now to use it with esp32 wroom32 but there is always this error

Arduino: 1.8.19 (Windows 7), Board: "ESP32 Dev Module, Disabled, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, Core 1, Core 1, None, Disabled"


In file included from C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealth.cpp:41:

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\i2c.h:3:10: fatal error: avr/io.h: No such file or directory

 #include <avr/io.h>

          ^~~~~~~~~~

compilation terminated.

exit status 1

Error compiling for board ESP32 Dev Module.


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

and this is the i2c.h code

//      This library provides the high-level functions needed to use the I2C
//   serial interface supported by the hardware of several AVR processors.
#include <avr/io.h>
#include <avr/interrupt.h>
#include "types.h"
#include "defs.h"

// TWSR values (not bits)
// (taken from avr-libc twi.h - thank you Marek Michalkiewicz)
// Master
#define TW_START               0x08
#define TW_REP_START            0x10
// Master Transmitter
#define TW_MT_SLA_ACK            0x18
#define TW_MT_SLA_NACK            0x20
#define TW_MT_DATA_ACK            0x28
#define TW_MT_DATA_NACK            0x30
#define TW_MT_ARB_LOST            0x38
// Master Receiver
#define TW_MR_ARB_LOST            0x38
#define TW_MR_SLA_ACK            0x40
#define TW_MR_SLA_NACK            0x48
#define TW_MR_DATA_ACK            0x50
#define TW_MR_DATA_NACK            0x58
// Slave Transmitter
#define TW_ST_SLA_ACK            0xA8
#define TW_ST_ARB_LOST_SLA_ACK      0xB0
#define TW_ST_DATA_ACK            0xB8
#define TW_ST_DATA_NACK            0xC0
#define TW_ST_LAST_DATA            0xC8
// Slave Receiver
#define TW_SR_SLA_ACK            0x60
#define TW_SR_ARB_LOST_SLA_ACK      0x68
#define TW_SR_GCALL_ACK            0x70
#define TW_SR_ARB_LOST_GCALL_ACK   0x78
#define TW_SR_DATA_ACK            0x80
#define TW_SR_DATA_NACK            0x88
#define TW_SR_GCALL_DATA_ACK      0x90
#define TW_SR_GCALL_DATA_NACK      0x98
#define TW_SR_STOP               0xA0
// Misc
#define TW_NO_INFO               0xF8
#define TW_BUS_ERROR            0x00

// defines and constants
#define TWCR_CMD_MASK      0x0F
#define TWSR_STATUS_MASK   0xF8

// return values
#define I2C_OK            0x00
#define I2C_ERROR_NODEV      0x01

#define sbi(var, mask)   ((var) |= (uint8_t)(1 << mask))
#define cbi(var, mask)   ((var) &= (uint8_t)~(1 << mask))

#define WRITE_sda() DDRC = DDRC | 0b00010000 //SDA must be output when writing
#define READ_sda()  DDRC = DDRC & 0b11101111 //SDA must be input when reading - don't forget the resistor on SDA!!

// functions

//! Initialize I2C (TWI) interface
void i2cInit(void);

//! Set the I2C transaction bitrate (in KHz)
void i2cSetBitrate(unsigned short bitrateKHz);

// Low-level I2C transaction commands 
//! Send an I2C start condition in Master mode
void i2cSendStart(void);
//! Send an I2C stop condition in Master mode
void i2cSendStop(void);
//! Wait for current I2C operation to complete
void i2cWaitForComplete(void);
//! Send an (address|R/W) combination or a data byte over I2C
void i2cSendByte(unsigned char data);
//! Receive a data byte over I2C  
// ackFlag = TRUE if recevied data should be ACK'ed
// ackFlag = FALSE if recevied data should be NACK'ed
void i2cReceiveByte(unsigned char ackFlag);
//! Pick up the data that was received with i2cReceiveByte()
unsigned char i2cGetReceivedByte(void);
//! Get current I2c bus status from TWSR
unsigned char i2cGetStatus(void);
void delay_ms(uint16_t x);

// high-level I2C transaction commands

//! send I2C data to a device on the bus (non-interrupt based)
unsigned char i2cMasterSendNI(unsigned char deviceAddr, unsigned char length, unsigned char* data);
//! receive I2C data from a device on the bus (non-interrupt based)
unsigned char i2cMasterReceiveNI(unsigned char deviceAddr, unsigned char length, unsigned char *data);

/*********************
 ****I2C Functions****
 *********************/

void i2cInit(void)
{
   // set i2c bit rate to 40KHz
   i2cSetBitrate(100);
   // enable TWI (two-wire interface)
   sbi(TWCR, TWEN);   // Enable TWI
}

void i2cSetBitrate(unsigned short bitrateKHz)
{
   unsigned char bitrate_div;
   // set i2c bitrate
   // SCL freq = F_CPU/(16+2*TWBR))
   cbi(TWSR, TWPS0);
   cbi(TWSR, TWPS1);
   
   //calculate bitrate division   
   bitrate_div = ((F_CPU/4000l)/bitrateKHz);
   if(bitrate_div >= 16)
      bitrate_div = (bitrate_div-16)/2;
   outb(TWBR, bitrate_div);
}

void i2cSendStart(void)
{
   WRITE_sda();
   // send start condition
   TWCR = (1<<TWINT)|(1<<TWSTA)|(1<<TWEN);
}

void i2cSendStop(void)
{
   // transmit stop condition
        TWCR = (1<<TWINT)|(1<<TWEN)|(1<<TWSTO);
}

void i2cWaitForComplete(void)
{
   int i = 0;      //time out variable
   
   // wait for i2c interface to complete operation
    while ((!(TWCR & (1<<TWINT))) && (i < 90))
      i++;
}

void i2cSendByte(unsigned char data)
{
   delay_ms(1);
   //printf("sending 0x%x\n", data);
   WRITE_sda();
   // save data to the TWDR
   TWDR = data;
   // begin send
   TWCR = (1<<TWINT)|(1<<TWEN);
}

void i2cReceiveByte(unsigned char ackFlag)
{
   // begin receive over i2c
   if( ackFlag )
   {
      // ackFlag = TRUE: ACK the recevied data
      outb(TWCR, (inb(TWCR)&TWCR_CMD_MASK)|BV(TWINT)|BV(TWEA));
   }
   else
   {
      // ackFlag = FALSE: NACK the recevied data
      outb(TWCR, (inb(TWCR)&TWCR_CMD_MASK)|BV(TWINT));
   }
}

unsigned char i2cGetReceivedByte(void)
{
   // retieve received data byte from i2c TWDR
   return( inb(TWDR) );
}

unsigned char i2cGetStatus(void)
{
   // retieve current i2c status from i2c TWSR
   return( inb(TWSR) );
}

void delay_ms(uint16_t x)
{
  uint8_t y, z;
  for ( ; x > 0 ; x--){
    for ( y = 0 ; y < 90 ; y++){
      for ( z = 0 ; z < 6 ; z++){
        asm volatile ("nop");
      }
    }
  }
}

Try an AVR-based board.

1 Like

i used Arduino uno board it worked but the same error about this

Arduino: 1.8.19 (Windows 7), Board: "Arduino Uno"

In file included from C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp:33:0:

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.h:149:15: error: 'prog_uint8_t' has not been declared

      PROGMEM  prog_uint8_t *array);

               ^~~~~~~~~~~~

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp:41:11: error: 'prog_uint8_t' does not name a type; did you mean 'uint8_t'?

  PROGMEM  prog_uint8_t eHealthLogo[] = {

           ^~~~~~~~~~~~

           uint8_t

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp:109:10: error: 'prog_uint8_t' does not name a type; did you mean 'uint8_t'?

 PROGMEM  prog_uint8_t cookingLogo[] = {

          ^~~~~~~~~~~~

          uint8_t

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp: In member function 'void eHealthDisplayClass::init()':

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp:201:21: error: 'eHealthLogo' was not declared in this scope

   image(0,64,128,64,eHealthLogo);

                     ^~~~~~~~~~~

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp:201:21: note: suggested alternative: 'eHealth'

   image(0,64,128,64,eHealthLogo);

                     ^~~~~~~~~~~

                     eHealth

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp:209:21: error: 'cookingLogo' was not declared in this scope

   image(0,64,128,64,cookingLogo); delay(3000);

                     ^~~~~~~~~~~

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp: At global scope:

C:\Users\Pc\Documents\Arduino\libraries\ssiehealth\eHealthDisplay.cpp:663:20: error: 'prog_uint8_t' has not been declared

           PROGMEM  prog_uint8_t *array)

                    ^~~~~~~~~~~~

exit status 1

Error compiling for board Arduino Uno.



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

eHealthDisplay.cpp code

/*
 *  eHealth sensor platform for Arduino and Raspberry from Cooking-hacks.
 *
 *  Description: "The e-Health Sensor Shield allows Arduino and Raspberry Pi 
 *  users to perform biometric and medical applications by using 9 different 
 *  sensors: Pulse and Oxygen in Blood Sensor (SPO2), Airflow Sensor (Breathing),
 *  Body Temperature, Electrocardiogram Sensor (ECG), Glucometer, Galvanic Skin
 *  Response Sensor (GSR - Sweating), Blood Pressure (Sphygmomanometer) and 
 *  Patient Position (Accelerometer)."
 *
 *  Copyright (C) 2012 Libelium Comunicaciones Distribuidas S.L.
 *  http://www.libelium.com
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Version 0.1
 *  Author: Luis Martín & Ahmad Saad
 */


// include this library's description file
#include "eHealthDisplay.h"
#ifndef eHealth_h
	#include "eHealth.h"
#endif

#define pushButton 4

//LOGO EHEALTH
	PROGMEM  prog_uint8_t eHealthLogo[] = {
	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, 0x07, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x1F, 0x00, 0x3C, 0x00, 0x78, 0x0F, 0x0E, 0x18, 0x0F, 0xC0, 0x0F, 0xC0, 0x00, 0x00,
	0x00, 0x00, 0x7F, 0xC0, 0xFE, 0x01, 0xFE, 0x0F, 0x1F, 0x3C, 0x1F, 0xF0, 0x1F, 0xE0, 0x00, 0x00,
	0x00, 0x00, 0xFF, 0xC1, 0xFF, 0x83, 0xFF, 0x0F, 0x3E, 0x3C, 0x3F, 0xF0, 0x3F, 0xF0, 0x00, 0x00,
	0x00, 0x01, 0xFF, 0xE3, 0xFF, 0x87, 0xFF, 0x8F, 0xFE, 0x3C, 0x7F, 0xF8, 0x7F, 0xF8, 0x00, 0x00,
	0x00, 0x01, 0xE1, 0xC7, 0xC7, 0xC7, 0xC7, 0xCF, 0xFC, 0x3C, 0x78, 0x7C, 0x78, 0x78, 0x00, 0x00,
	0x00, 0x01, 0xE0, 0x07, 0x83, 0xC7, 0x83, 0xCF, 0xF8, 0x3C, 0xF0, 0x3C, 0xF0, 0x3C, 0x00, 0x00,
	0x00, 0x01, 0xC0, 0x07, 0x83, 0xCF, 0x03, 0xCF, 0xF0, 0x3C, 0xF0, 0x3C, 0xF0, 0x3C, 0x00, 0x00,
	0x00, 0x01, 0xE0, 0x07, 0x83, 0xC7, 0x03, 0xCF, 0xF0, 0x3C, 0xF0, 0x3C, 0xF0, 0x3C, 0x00, 0x00,
	0x00, 0x01, 0xE0, 0xC7, 0x83, 0xC7, 0x83, 0xCF, 0xFC, 0x3C, 0xF0, 0x3C, 0x78, 0x7C, 0x00, 0x00,
	0x00, 0x01, 0xFF, 0xC7, 0xC7, 0xC7, 0xC7, 0x8F, 0xFE, 0x3C, 0xF0, 0x3C, 0x7F, 0xF8, 0x00, 0x00,
	0x00, 0x00, 0xFF, 0xE3, 0xFF, 0x83, 0xFF, 0x8F, 0x3E, 0x3C, 0xF0, 0x3C, 0x7F, 0xF8, 0x00, 0x00,
	0x00, 0x00, 0x7F, 0xC1, 0xFF, 0x03, 0xFF, 0x0F, 0x1F, 0x3C, 0xF0, 0x3C, 0x3F, 0xFC, 0x00, 0x00,
	0x00, 0x00, 0x3F, 0x00, 0xFE, 0x00, 0xFE, 0x07, 0x0E, 0x38, 0x70, 0x38, 0x0F, 0xFC, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFC, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xF8, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF8, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x7F, 0xF0, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x60, 0x3E, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1F, 0xF8, 0x03, 0xF8, 0x03, 0xF0, 0x78, 0xF0, 0xFF, 0x80, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1F, 0xFC, 0x07, 0xFC, 0x0F, 0xFC, 0x79, 0xF1, 0xFF, 0x80, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1F, 0xFE, 0x0F, 0xFE, 0x0F, 0xFC, 0x7B, 0xF3, 0xFF, 0x80, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1F, 0xBF, 0x1F, 0x3E, 0x1F, 0x3C, 0x7F, 0xE3, 0xC0, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x0F, 0x1E, 0x0F, 0x1E, 0x08, 0x7F, 0xC3, 0xFE, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x0F, 0x3C, 0x0F, 0x3C, 0x00, 0x7F, 0x03, 0xFF, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x07, 0xBC, 0x0F, 0x3C, 0x00, 0x7F, 0x01, 0xFF, 0x80, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x07, 0x9E, 0x0F, 0x3C, 0x00, 0x7F, 0x80, 0xFF, 0xC0, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x07, 0x9E, 0x1F, 0x1E, 0x1C, 0x7F, 0xC0, 0x03, 0xC0, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x07, 0x9F, 0xFF, 0x1F, 0xFC, 0x7B, 0xE0, 0xFF, 0xC0, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x07, 0x8F, 0xFF, 0x0F, 0xFC, 0x79, 0xF1, 0xFF, 0x80, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x1E, 0x07, 0x07, 0xFF, 0x07, 0xF8, 0x78, 0xF1, 0xFF, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x0C, 0x07, 0x01, 0xE6, 0x01, 0xE0, 0x30, 0x60, 0xFE, 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, 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,
	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, 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, 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, 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
};

//Cooking-Hacks logo. 
PROGMEM  prog_uint8_t cookingLogo[] = {
	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, 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, 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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x01, 0x83, 0x00, 0x00, 0x00, 0x06, 0x0C, 0x00, 0xC0, 0x00, 0x00, 0x07, 0xF0, 0x00,
	0x00, 0x00, 0x03, 0xC7, 0x80, 0x00, 0x00, 0x0F, 0x1E, 0x01, 0xE0, 0x00, 0x00, 0x07, 0xF0, 0x00,
	0x00, 0x00, 0x03, 0xC7, 0x80, 0x00, 0x00, 0x0F, 0x1E, 0x01, 0xE0, 0x00, 0x00, 0x07, 0xF0, 0x00,
	0x00, 0x00, 0x03, 0xC7, 0x80, 0x00, 0x00, 0x0F, 0x1F, 0xE1, 0xE0, 0x00, 0x00, 0x07, 0xF0, 0x00,
	0x1F, 0xC0, 0x03, 0xC7, 0x8F, 0xE0, 0x7F, 0x0F, 0x1F, 0xF1, 0xFF, 0x00, 0x00, 0x07, 0xF0, 0x00,
	0x3F, 0xE0, 0x03, 0xC7, 0x9F, 0xF0, 0xFF, 0x8F, 0x1F, 0xF1, 0xFF, 0x80, 0x00, 0x07, 0xF0, 0x00,
	0x30, 0x70, 0x03, 0xFF, 0x98, 0x38, 0xFF, 0x8F, 0x1F, 0xE1, 0xFF, 0xC0, 0x00, 0x07, 0xF0, 0x00,
	0x70, 0x73, 0xF3, 0xFF, 0xB8, 0x39, 0xE3, 0xCF, 0x1E, 0x01, 0xFF, 0xC0, 0x00, 0x07, 0xF0, 0x00,
	0x7F, 0xF7, 0xFB, 0xFF, 0xBF, 0xF9, 0xC1, 0xCF, 0x1E, 0x01, 0xE3, 0xC0, 0x00, 0x07, 0xF0, 0x00,
	0x7F, 0xF3, 0xF3, 0xC7, 0xBF, 0xF9, 0xC1, 0xCF, 0x1E, 0x01, 0xE3, 0xC0, 0x00, 0x07, 0xF0, 0x00,
	0x7F, 0xE0, 0x03, 0xC7, 0xBF, 0xF1, 0xE3, 0xCF, 0x1F, 0x39, 0xE3, 0xC0, 0x00, 0x07, 0xF0, 0x00,
	0x30, 0x00, 0x03, 0xC7, 0x98, 0x00, 0xFF, 0xCF, 0x8F, 0xF9, 0xE3, 0xC0, 0x3F, 0xFF, 0xFF, 0xFE,
	0x3F, 0xC0, 0x03, 0xC7, 0x9F, 0xE0, 0xFF, 0xCF, 0xE7, 0xF9, 0xE3, 0xC0, 0x3F, 0xFF, 0xFF, 0xFE,
	0x1F, 0xC0, 0x03, 0xC7, 0x8F, 0xE0, 0x7E, 0xC7, 0xE3, 0xF0, 0xC1, 0x80, 0x3F, 0xFF, 0xFF, 0xFE,
	0x00, 0x00, 0x01, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFE,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFE,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFE,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFE,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xF0, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xF0, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xF0, 0x00,
	0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xE0, 0x00, 0x00, 0x00, 0x40, 0x00, 0x07, 0xF0, 0x00,
	0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x40, 0x00, 0x07, 0xF0, 0x00,
	0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x40, 0x00, 0x07, 0xF0, 0x00,
	0x20, 0x0F, 0xDF, 0x9F, 0x1F, 0x1C, 0x0F, 0xF1, 0xF1, 0xF1, 0xCF, 0xC0, 0x00, 0x07, 0xF0, 0x00,
	0x1F, 0x90, 0x50, 0xA0, 0x20, 0xA0, 0x08, 0x0A, 0x08, 0x0A, 0x10, 0x40, 0x00, 0x07, 0xF0, 0x00,
	0x00, 0x5F, 0xD0, 0x9F, 0x20, 0xA0, 0x08, 0x0A, 0x09, 0xFA, 0x10, 0x40, 0x00, 0x07, 0xF0, 0x00,
	0x00, 0x50, 0x10, 0x80, 0xA0, 0xA0, 0x08, 0x0A, 0x0A, 0x0A, 0x10, 0x40, 0x00, 0x07, 0xF0, 0x00,
	0x00, 0x50, 0x10, 0x80, 0xA0, 0xA0, 0x08, 0x0A, 0x0A, 0x0A, 0x10, 0x40, 0x00, 0x07, 0xF0, 0x00,
	0x3F, 0x8F, 0x90, 0x9F, 0x1F, 0x20, 0x0F, 0xF1, 0xF1, 0xF2, 0x0F, 0xC0, 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, 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,
	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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
//***************************************************************
// Constructor of the class										*
//***************************************************************

	eHealthDisplayClass::eHealthDisplayClass(void){/*void constructor*/}

//***************************************************************
// Public Methods												*
//***************************************************************

	//!******************************************************************
	//!	Name: init()													*
	//!	Description: Configure and initializes the LCD.					*
	//!	Param : void													*
	//!	Returns: void													*
	//!	Example: eHealthDisplay.init();									*
	//!******************************************************************
	
	void eHealthDisplayClass::init(void)
	{
		//Configure the eHealth push-Button
		pinMode(pushButton, INPUT);
		clearLCD();
		delay(2000);

		//It prints the eHealth logo. 
		image(0,64,128,64,eHealthLogo);

		coordinates(1, 15);
		writeLCD("www.cooking-hacks.com"); 	delay(4000);

		clearLCD();

		//It prints cooking hacks logo. 
		image(0,64,128,64,cookingLogo);	delay(3000); 
		clearLCD();  
		delay(500);
	}

	//!******************************************************************
	//!	Name: initValuesScreen()										*
	//!	Description: Configure some parameters of the values screen.	*
	//!	Param : void													*
	//!	Returns: void													*
	//!	Example: eHealthDisplay.initValuesScreen();						*
	//!******************************************************************
	
	void eHealthDisplayClass::initValuesScreen()
	{
		bodyPosition = 0;
		oxygen = 0;
		
		eHealth.initPositionSensor();	delay(50);
		eHealth.initPulsioximeter();	delay(50);
		clearLCD();		delay(50);
		
		coordinates(99, 60);	writeLCD("Pose");			delay(100);
		coordinates(1,60);		writeLCD("CURRENT DATA");	delay(100);
		coordinates(1, 47);		writeLCD("Pulse (bpm)");	delay(100);
		coordinates(1, 35);		writeLCD("Conductance");	delay(100);
		coordinates(1, 22);		writeLCD("Oxygen");			delay(100);
		coordinates(90, 22);	writeLCD("%");				delay(100);
		coordinates(1, 9);		writeLCD("Temperature");	delay(100);
		coordinates(105, 9);	writeLCD("C");				delay(100);
		
		pixel (103,9,1);	pixel (104,9,1);
		pixel (103,8,1);	pixel (104,8,1);
	}

	//!******************************************************************
	//!	Name:	printValuesScreen()										*
	//!	Description: Refresh the values of the sensors in the screen.	*
	//!	Param : void													*
	//!	Returns: void													*
	//!	Example: eHealthDisplay.printValuesScreen();					*
	//!******************************************************************
	
	void eHealthDisplayClass::printValuesScreen(void)
	{
		
		delay(100);

		//Prints the current value of diastolic pressure.
		if (pulse != eHealth.getBPM()) {
			pulse = eHealth.getBPM();
			clearSpace(70, 40, 90, 47);
			coordinates(70,47);	Serial.print(pulse);
			delay(10);
		}

		//Stores the current value of skin conductance. 
		float conductance = eHealth.getSkinConductance();
		delay(20);

		//If conductance == -1, the sensor is no connected. 
		if ( conductance == -1 ) {
			coordinates(70,35);	Serial.print(F("NOCN")); //No connected message. 
			delay(10);
		} 
		else {		
			coordinates(70,35);	Serial.print(conductance,2);
			delay(10);
		}

		if (oxygen != eHealth.getOxygenSaturation())
		{
			oxygen = eHealth.getOxygenSaturation();
			clearSpace(70, 15, 90, 22);
			coordinates(70, 22);	Serial.print(oxygen);
			delay(10);
		}

		//Prints the current value of temperature. 
		coordinates(70,9);	Serial.print(eHealth.getTemperature(),2);
		delay(10);

		//If no changes in position, don't refresh the screen. 
		if (bodyPosition != eHealth.getBodyPosition()) {

			bodyPosition = eHealth.getBodyPosition();
			clearSpace(95, 34, 117, 50); // Clear the previous position. 

				 if (bodyPosition == 1) supinePosition();
			else if (bodyPosition == 2) leftLateralPosition();
			else if (bodyPosition == 3) rigthLateralPosition();
			else if (bodyPosition == 5) standPosition();
			else pronePosition();
		}
				
		delay(10);
	}

	//!******************************************************************
	//!	Name:	initECGScreen()											*
	//!	Description: Configure some parameters of the ECG screen.		*
	//!	Param : void													*
	//!	Returns: void													*
	//!	Example: eHealthDisplay.initECGScreen();						*
	//!******************************************************************
	
	void eHealthDisplayClass::initECGScreen(void)
	{
		clearLCD();    
		delay(200);

		timePrevious = 0;
		timePreviousMeassure = 0;
		time = 0;
		countPrevious = 0;

		//ECG LOGO
		line(20, 49, 21, 49, 1); 	line(22, 49, 24, 55, 1);
		line(24, 55, 28, 45, 1);	line(28, 45, 29, 49, 1);
		line(29, 49, 32, 49, 1);	delay(100);        

		//LETRAS POR PANTALLA 
		coordinates(42, 52);	writeLCD("ECG");
		coordinates(100, 52);	writeLCD( "cpm"); 

		delay(150);
		timePreviousMeassure = millis();
		count = 0;
		printHeart(1);
		x = 8;
	}

	//!******************************************************************
	//!		Name:	printECGScreen()									*
	//!		Description: Refresh the ECG wave in the LCD screen.		*
	//!		Param : void												*
	//!		Returns: void												*
	//!		Example: eHealthDisplay.printECGScreen();					*
	//!******************************************************************
	
	void eHealthDisplayClass::printECGScreen(void)
	{
		
		for (int j=0; j<45; j++){
			pixel(8,j,0);
		}
		
		delay(20);

		if (millis()-timePreviousMeassure > 10000){
			countsPerMinute = 6*count;
			timePreviousMeassure = millis();
			count = 0;
			//Clear space
			coordinates(95, 52);	backspace();
			coordinates(90, 52);	backspace();
			coordinates(85, 52);	backspace();
			coordinates(80, 52);	backspace();
			writeLcdDec(countsPerMinute);
			delay(20);
		}

		delay(10);
		printHeart(1);

		// Input 1   
		valRead = map(analogRead(0), 0, 1023, 5, 45);
		pixel (x, valRead, 1);

		if(x>12){
			line(x-1, prevRead, x, valRead, 1);
		}

		//Hearth blink
		if(valRead> 30)
		{
			count=count+1;
			printHeart(0);
			delay(200);
		}

		//Wave refresh 
		for (int j = 5; j<45; j++){
			pixel(x+1,j,0);
		}

		//Previous value
		prevRead = valRead;
		x++; 		
		if (x == 120) x = 8;
	}

	//!******************************************************************
	//!	Name: initAirFlowScreen()										*
	//!	Description: Configure some parameters of the AirFlow screen.	*
	//!	Param : void													*
	//!	Returns: void													*
	//!	Example: eHealthDisplay.initAirFlowScreen();					*
	//!******************************************************************
	
	void eHealthDisplayClass::initAirFlowScreen()
	{
		clearLCD();
		delay(200);

		timePrevious = 0;
		timePreviousMeassure = 0;
		time = 0;
		countPrevious = 0;
		coordinates(53, 52);
		writeLCD( "bpm");

		printLung(1);	delay(200);
		
		timePreviousMeassure = millis();
		count = 0;

		x=8;
	}

	//!******************************************************************
	//!	Name: printAirFlowScreen()										*
	//!	Description: It prints the AirFlow wave in the LCD screen.		*
	//!	Param : void													*
	//!	Returns: void													*
	//!	Example: eHealthDisplay.printAirFlowScreen();					*
	//!******************************************************************
	
	void eHealthDisplayClass::printAirFlowScreen(void)
	{
		int j = 0;
		
		for (j=0; j<45; j++)
		{
			pixel(8, j, 0);
		}
		
		delay(10);   

		//Lung picture
		if (millis()-timePreviousMeassure > 10000) {
			countsPerMinute = 6*count;
			timePreviousMeassure = millis();
			//Apnea signal OFF

			apneaAdvise(0);

			coordinates(94, 52);	backspace();
			coordinates(99, 52);	backspace();
			coordinates(104, 52);	backspace();
			coordinates(109, 52);	backspace();
			coordinates(114, 52);	backspace();
			coordinates(119, 52);	backspace();
			coordinates(124, 52);	backspace();
			delay(10);  

			if(count ==0 ){
				//Apnea sinal ON
				apneaAdvise(1);

				coordinates(94, 52);
				writeLCD("Apnea");
				delay(5);
			}

			count = 0;
			//Clear the space
			coordinates(53, 52);	backspace();
			coordinates(50, 52);	backspace();
			coordinates(45, 52);	backspace();
			coordinates(40, 52);	backspace();

			writeLcdDec(countsPerMinute);
			delay(20);
		}

			//Lung ON
			printLung(1);

			// Input 1   
			valRead = analogRead(1);

			valRead   = map(valRead, 0, 1023, 5, 45);
			delay(100);
			pixel (x, valRead, 1);
     
			if(x>8){
				line(x-1, prevRead, x, valRead, 1);
			}

			if(valRead> 7)	waveState=1;
			

			if(waveState==1)
			{
				if(valRead<6)
				{
					//Lung OFF
					printLung(0);
					count=count+1;
					waveState=0;
					delay(100);
				}
			}

			//Wave refresh
			for (j = 5; j < 40 ; j++)
			{
				pixel(x+1,j,0);
			}

			prevRead = valRead;  

		x++;

		if (x == 120) x = 8;
	}

//***************************************************************
// Private Methods												*
//***************************************************************

	//! Clear all data writed in the LCD. 
	void eHealthDisplayClass::clearLCD()
	{
		Serial.print(char(0x7C));
		Serial.print(char(0x00));
		delay(20);
	}

	//! It writes data in decimal format.
	void eHealthDisplayClass::writeLcdDec(int data)
	{
		Serial.print(data,DEC);
		delay(20);
	}

	//! It prints data in the LCD.
	void eHealthDisplayClass::writeLCD(char *data){
	  Serial.print(data);
	  delay(20);
	}
	
	//! It prints a back space in the LCD.
	void eHealthDisplayClass::backspace()
	{
		Serial.print(char(0x08));
		delay(20);
	}

	/*! It changes the baud rate uart communication with the LCD. 
		"1" =  4.800bps "2" =  96,00bps
		"3" = 19,200bps "4" =  38,400bps 
		"5" = 57,600bps "6" = 115,200bps
	*/
	void eHealthDisplayClass::changeBaudrate(char frec)
	{								//"1" =  4.800bps "2" =  96,00bps
		Serial.print(char(0x7C));	//"3" = 19,200bps "4" =  38,400bps 
		Serial.print(char(0x07));	//"5" = 57,600bps "6" = 115,200bps
		Serial.print(char(frec)); 
		delay(20);
	}

	//! It places the write pointer in the x-y position.  
	void eHealthDisplayClass::coordinates(int x, int y)
	{									//x from 0 to 127
		Serial.print(char(0x7C));		//y from 0 to  63
		Serial.print(char(0x18));
		Serial.print(char(x));
		Serial.print(char(0x7C)); 
		Serial.print(char(0x19));
		Serial.print(char(y));
		delay(20);
	}

	//! It activates or deactivates a pixel. 
	void eHealthDisplayClass::pixel (int x, int y, int onOff)
	{									//x from 0 to 127 
		Serial.print(char(0x7C));		//y from 0 to  63
		Serial.print(char(0x10));		//on_off=1 ON
		Serial.print(char(x));			//on_off=0 Off
		Serial.print(char(y));
		Serial.print(char(onOff));
	}

	//!It draws or erases a line. 
	void eHealthDisplayClass::line (int fromX,
									int fromY,
									int toX,
									int toY,
									int onOff)
	{ 
		Serial.print(char(0x7C));
		Serial.print(char(0x0C));
		Serial.print(char(fromX));
		Serial.print(char(fromY));
		Serial.print(char(toX));
		Serial.print(char(toY));
		Serial.print(char(onOff));
		delay(20);
	}

	//! It draws or erases a circule. 
	void eHealthDisplayClass::eHealthDisplayClass::circle (	int x,
															int y,
															int radio,
															int onOff)
	{ 
		Serial.print(char(0x7C));             
		Serial.print(char(0x03));               
		Serial.print(char(x));
		Serial.print(char(y));
		Serial.print(char(radio));  
		Serial.print(char(onOff));
		delay(20);
	}

	//! It draws or erases a rectangle. 
	void eHealthDisplayClass::rectangle(int fromX,
										int fromY,
										int toX,
										int toY,
										int onOff)
	{ 
		Serial.print(char(0x7C));             
		Serial.print(char(0x0F));               
		Serial.print(char(fromX));
		Serial.print(char(fromY));
		Serial.print(char(toX));
		Serial.print(char(toY));  
		Serial.print(char(onOff));
		delay(20);
	}

	//! It clears an area of the LCD. 
	void eHealthDisplayClass::clearSpace (	int fromX,
											int fromY,
											int toX,
											int toY)
	{ 
		Serial.print(char(0x7C));
		Serial.print(char(0x05));
		Serial.print(char(fromX));
		Serial.print(char(fromY));
		Serial.print(char(toX));
		Serial.print(char(toY));  
		delay(20);
	}

	//! It draws an image stored in an array.
	void eHealthDisplayClass::image (	int desde_x,
										int desde_y,
										int ancho,
										int alto,
										PROGMEM  prog_uint8_t *array)
	{ 
		q=0;
		final=ancho+desde_x;
		y=alto-1; 
		for (a = 0; a <= alto ; a++)
		{
			for (x = desde_x; x < final ; x=x+8)   
			{       
				temp = pgm_read_word_near(array + q);
				for (z=x; z < (x+8); z++)
			{
				if (temp & 0x80)pixel(z,y,1);
				temp= temp<<1;
			} 
			q++;
			}
			y--;
		}
	}


	//! It prints a lung in the AirFlow screen. 
	void eHealthDisplayClass::printLung(uint8_t onOff)
	{
		pixel (10,50 , onOff);	pixel (10,49 , onOff);	pixel (10,48 , onOff);
		pixel (10,47 , onOff);	pixel (10,46 , onOff);	pixel (11,51 , onOff);
		pixel (11,46 , onOff);	pixel (12,52 , onOff);	pixel (12,46 , onOff);
		pixel (13,53 , onOff);	pixel (13,46 , onOff);	pixel (14,53 , onOff);
		pixel (14,52 , onOff);	pixel (14,51 , onOff);	pixel (14,50 , onOff);
		pixel (14,49 , onOff);	pixel (14,48 , onOff);	pixel (14,47 , onOff);
		pixel (14,46 , onOff);	pixel (15,50 , onOff);	pixel (16,51 , onOff);
		pixel (16,52 , onOff);	pixel (16,53 , onOff);	pixel (16,54 , onOff);
		pixel (16,55 , onOff);	pixel (16,56 , onOff);	pixel (17,50 , onOff);       
		pixel (13,51 , onOff);	pixel (19,51 , onOff);	pixel (13,49 , onOff);
		pixel (19,49 , onOff);	pixel (18,53 , onOff);	pixel (18,52 , onOff);
		pixel (18,51 , onOff);	pixel (18,50 , onOff);	pixel (18,49 , onOff);
		pixel (18,48 , onOff);	pixel (18,47 , onOff);	pixel (18,46 , onOff);
		pixel (19,53 , onOff);	pixel (19,46 , onOff);	pixel (20,52 , onOff);
		pixel (20,46 , onOff);	pixel (21,51 , onOff);	pixel (21,46 , onOff);
		pixel (22,50 , onOff);	pixel (22,49 , onOff);	pixel (22,48 , onOff);
		pixel (22,47 , onOff);	pixel (22,46 , onOff);
	}


	//!It prints the apnea advise.
	void eHealthDisplayClass::apneaAdvise(uint8_t onOff)
	{
		line(90, 41, 90, 56, onOff);	line(77, 41, 77, 56, onOff);
		line(77, 56, 90, 56, onOff);	line(77, 41, 90, 41, onOff);
		
		pixel (84,54,onOff);	pixel (84,53,onOff);	pixel (84,52,onOff);
		pixel (84,51,onOff);	pixel (84,50,onOff);	pixel (84,49,onOff);
		pixel (84,48,onOff);	pixel (84,47,onOff);	pixel (84,44,onOff);
		pixel (84,43,onOff);	pixel (83,54,onOff);	pixel (83,53,onOff);
		pixel (83,52,onOff);	pixel (83,51,onOff);	pixel (83,50,onOff);
		pixel (83,49,onOff);	pixel (83,48,onOff);	pixel (83,47,onOff);
		pixel (83,44,onOff);	pixel (83,43,onOff);
	}

	//! It prints a heart in the LCD.
	void eHealthDisplayClass::printHeart(uint8_t onOff)
	{
		pixel (10,50 , onOff);	pixel (11,51 , onOff);
		pixel (12,50 , onOff);	pixel (13,49 , onOff);
		pixel (14,50 , onOff);	pixel (15,51 , onOff);
		pixel (16,50 , onOff);	pixel (10,50 , onOff);    
		pixel (10,49 , onOff);	pixel (16,49 , onOff);
		pixel (11,48 , onOff);	pixel (15,48 , onOff);
		pixel (12,47 , onOff);	pixel (14,47 , onOff);
		pixel (13,46 , onOff);
	}

	//! It prints a guy in stand/sit position.  
	void eHealthDisplayClass::standPosition()
	{
		line(108,50,113,50,1);	line(107,49,114,49,1);
		line(107,48,108,48,1);	line(110,48,111,48,1);
		line(113,48,114,48,1);	line(107,47,114,47,1);
		line(107,46,114,46,1);	line(107,45,108,45,1);
		line(113,45,114,45,1);	line(107,44,114,44,1);
		line(108,43,113,43,1);	line(110,42,110,35,1);
	}

	//! It prints a guy in rigth lateral position.
	void eHealthDisplayClass::rigthLateralPosition()
	{
		line(100, 35, 100, 40, 1);	line(101, 34, 101, 41, 1);
		line(102, 34, 102, 35, 1);	line(102, 37, 102, 38, 1);
		line(102, 40, 102, 41, 1);	line(103, 34, 103, 41, 1);
		line(104, 34, 104, 41, 1);	line(105, 34, 105, 35, 1);
		line(105, 40, 105, 41, 1);	line(106 ,34, 106, 41, 1);
		line(107 ,35, 107, 40, 1);	line(108, 37, 115, 37,1);
	}

	//! It prints a guy in letf lateral position.  
	void eHealthDisplayClass::leftLateralPosition()
	{
		line(100, 35, 100, 40, 1);	line(101, 34, 101, 41, 1);
		line(102, 34, 102, 41, 1);	line(103, 34, 103, 41, 1);
		line(104, 34, 104, 41, 1);	line(105, 34, 105, 41, 1);
		line(106 ,34, 106, 41, 1);	line(107 ,35, 107, 40, 1);
		line(108, 37, 115, 37,1);
	}

	//! It prints a guy in supine position.
	void eHealthDisplayClass::supinePosition()
	{
		line(100, 35, 100, 40, 1);	line(101, 34, 101, 41, 1);
		line(102, 34, 102, 38, 1);	line(102, 40, 102, 41, 1);
		line(103, 34, 103, 41, 1);	line(104, 34, 104, 41, 1);
		line(105, 34, 105, 38, 1);	line(106 ,34, 106, 41, 1);
		line(107 ,35, 107, 40, 1);	line(107 ,37, 114, 37, 1);
	}

	//! It prints a guy in prone position.
	void eHealthDisplayClass::pronePosition()
	{
		line(100, 35, 100, 40, 1);	line(101, 34, 101, 41, 1);
		line(102, 34, 102, 35, 1);	line(102, 37, 102, 41, 1);
		line(103, 34, 103, 41, 1);	line(104, 34, 104, 41, 1);
		line(105, 38, 105, 41, 1);	line(106 ,34, 106, 41, 1);
		line(107 ,35, 107, 40, 1);	line(107 ,37, 114, 37, 1);
	}
	

//***************************************************************
// Preinstantiate Objects										*
//***************************************************************

	eHealthDisplayClass eHealthDisplay = eHealthDisplayClass();


and this is the eHealthDisplay.h code

/*
 *  eHealth sensor platform for Arduino and Raspberry from Cooking-hacks.
 *
 *  Description: "The e-Health Sensor Shield allows Arduino and Raspberry Pi 
 *  users to perform biometric and medical applications by using 9 different 
 *  sensors: Pulse and Oxygen in Blood Sensor (SPO2), Airflow Sensor (Breathing),
 *  Body Temperature, Electrocardiogram Sensor (ECG), Glucometer, Galvanic Skin
 *  Response Sensor (GSR - Sweating), Blood Pressure (Sphygmomanometer) and 
 *  Patient Position (Accelerometer)."
 * 
 *  Copyright (C) 2012 Libelium Comunicaciones Distribuidas S.L.
 *  http://www.libelium.com
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Version 0.1
 *  Author: Luis Martín & Ahmad Saad
 */


// ensure this library description is only included once
#ifndef eHealthClassDisplay_h
#define eHealthClassDisplay_h

#include "Arduino.h"
#include <avr/pgmspace.h> 

// Library interface description
class eHealthDisplayClass {
   
   public: 
  
//***************************************************************
// Constructor of the class                              *
//***************************************************************
  
      //! Class constructor.
      eHealthDisplayClass(void);
       
//***************************************************************
// Public Methods                                    *
//***************************************************************

      //! Configure and initializes the LCD.
      /*!
      \param void
      \return void
      */   void init(void);

      //! Configure some parameters of the values screen. 
      /*!
      \param void
      \return void
      */   void initValuesScreen();

      //! It prints (refresh) the values of the sensors in the screen. 
      /*!
      \param void
      \return void
      */   void printValuesScreen();

      //! Configure some parameters of the ECG screen. 
      /*!
      \param void
      \return void
      */   void initECGScreen(void);

      //! It prints (refresh) the ECG wave in the LCD screen.
      /*!
      \param void
      \return void
      */   void printECGScreen(void);
      
      //! Configure some parameters of the AirFlow screen. 
      /*!
      \param void
      \return void
      */   void initAirFlowScreen();
      
      //! It prints (refresh) the AirFlow wave in the LCD screen.
      /*!
      \param void
      \return void
      */   void printAirFlowScreen(void);


//***************************************************************
// Private Methods                                    *
//***************************************************************

   private:

      //! Clear all data writed in the LCD. 
      void clearLCD(void);

      //! It writes data in decimal format. 
      void writeLcdDec(int data);

      //! It prints data in the LCD.
      void writeLCD(char *data);

      //! It prints a back space in the LCD. 
      void backspace();

      /*! It changes the baud rate uart communication with the LCD. 
         "1" =  4.800bps "2" =  96,00bps
         "3" = 19,200bps "4" =  38,400bps 
         "5" = 57,600bps "6" = 115,200bps
      */
      void changeBaudrate(char frec);

      //! It places the write pointer in the x-y position.  
      void coordinates(int x, int y);

      //! It activates or deactivates a pixel.  
      void pixel (int x, int y, int onOff);
      
      //! It draws or erases a line. 
      void line (int fromX, int fromY, int toX, int toY, int onOff);

      //! It draws or erases a circule. 
      void circle  (int x, int y, int radio, int onOff);

      //! It draws or erases a rectangle. 
      void rectangle (int fromX, int fromY,
                  int toX,
                  int toY,
                  int onOff);

      //! It clears an area of the LCD. 
      void clearSpace (int fromX, int fromY, int toX, int toY);

      //! It draws an image stored in an array. 
      void image (int desde_x,
               int desde_y,
               int ancho,
               int alto,
               PROGMEM  prog_uint8_t *array);

      //! It prints a lung in the AirFlow screen. 
      void printLung(uint8_t onOff);

      //!It prints the apnea advise.
      void apneaAdvise(uint8_t onOff);

      //! It prints a heart in the LCD.
      void printHeart(uint8_t onOff);

      //! It prints a guy in stand/sit position.  
      void standPosition();

      //! It prints a guy in rigth lateral position.
      void rigthLateralPosition();

      //! It prints a guy in letf lateral position.  
      void leftLateralPosition();

      //! It prints a guy in supine position.
      void supinePosition();

      //! It prints a guy in prone position.
      void pronePosition();

//***************************************************************
// Private Variables                                 *
//***************************************************************

      //! It stores the number of breaths or beats. 
      int count;

      //! It stores the current value of the ECG or AirFlow sensor. 
      int valRead;

      //! It stores the previous value of the ECG or AirFlow sensor. 
      int prevRead;

      //! Number of counts per minute. It stores the number of
      //! breaths in air flow, and the number of beats in ECG.
      int  countsPerMinute;

      //! The previous value of time. 
      long timePrevious;

      //! It stores the time when the last measure was taked.
      long timePreviousMeassure;

      //! The current time. 
      long time;
      
      //! Previous value of count variable. 
      long countPrevious ;

      //! Vairable who indicates the current state of the wave.
      uint8_t waveState;

      //! It stores the current value of x position in the LCD.
      uint8_t x;

      //! It stores the current value of y position in the LCD.
      uint8_t y;

      //! Auxiliar variable.
      int z;

      //! Auxiliar variable.
      int q;

      //! Auxiliar variable.
      int a;

      //! The final size of the image. 
      int final;

      //! An auxiliar variable.
      unsigned char temp;

      //! It stores the current body position. 
      uint8_t bodyPosition;

      //! It stores the current blood oxygen saturation. 
      uint8_t oxygen;

      //! It stores the current value of pulse.
      uint8_t pulse; 
};

extern eHealthDisplayClass eHealthDisplay;

#endif

Update: I finally fix the problems of this last eHealthDisplay.h and eHealthDisplay.cpp code by adding the following line :

#define prog_uint8_t const uint8_t

in the eHealthDisplay.h code

// ensure this library description is only included once
#ifndef eHealthClassDisplay_h
#define eHealthClassDisplay_h
#define prog_uint8_t const uint8_t // <-- this is the adding line
#include "Arduino.h"
#include <avr/pgmspace.h> 

and also in the eHealthDisplay.cpp

// include this library's description file
#include "eHealthDisplay.h"
#ifndef eHealth_h
	#include "eHealth.h"
#endif

#define pushButton 4
#define prog_uint8_t const uint8_t   // <-- this is the adding line

thank you guys @gfvalvo for the first solution (eHealth.h ans cpp) @MorganS for the seconde code solution ((eHealthDisplay.h ans cpp)