How to include an already written library in a custom library in Arduino

I am creating a new library to control the keyboard and LCD together. Most of the code seems to compile, but when it reaches the line where I define the LiquidCristal variable, it says:

'LiquidCrystal' does not name type when creating user library

This is an excerpt from the contents of my LCDKeypad.h

// Include types & constants of Wiring core API
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#include "WConstants.h"
#endif

// Include LCD library
#include <LiquidCrystal.h>

The error in this line is:

private:
LiquidCrystal lcd( 8, 9, 4, 5, 6, 7 ); // <<-- Error
+5
source share
2 answers

Well, I read a lot, and I found a very interesting article on this subject:

Including several libraries

, , . , , LiquidCrystal.h .

, "LCDkeypad" LiquidCrystal. () LiquidCrystal, "LCDKeypad".

, - , LCDKeypad.h "Class LiquidCrystal", . LiquidCrystal.cpp . , .

+5

  • .h c _c. , .

:

#ifndef LCD_H
#define LCD_H

//Declaration of variable /functions
#endif
  • . D:\arduino\arduino\libraries

:

  • .

+1

All Articles