Your .h file looks OK to me. You need to make at least two changes to your .cpp file:
- Change:
LCDvario::LCDvario(uint8_t rs,uint8_t enable,uint8_t d0,uint8_t d1,uint8_t d2,uint8_t d3)
to:
LCDvario::LCDvario(uint8_t rs,uint8_t enable,uint8_t d0,uint8_t d1,uint8_t d2,uint8_t d3) : _lcd(rs,enable,d0,d1,d2,d3)
That's how you initialize a member variable of a type that doesn't have a default constructor.
- Change:
void LCDvario::begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS)
to:
void LCDvario::begin(uint8_t cols, uint8_t rows, uint8_t charsize)
Default parameter values are declared only in the prototype, not in a separate implementation.
It's not essential, but in the .h file I would replace:
extern "C" {
#include <string.h>
}
#include <stdlib.h> // needed for 'free'
by:
#include <cstring>
#include <cstdlib> // needed for 'free'
Finally, I strongly advise against calling 'free' or doing any other sort of dynamic memory allocation & freeing in embedded software, other than (if needed) allocations during the startup phase that are never freed. See Escher Technologies Articles on Formal Verification> for why.