Hi guys i m at the end of my sanity with this so i thought there might be someone able to help me.
This is main program made as easy as posible:
#include <LiquidCrystal.h>
#include <LiquidCrystal_I2C.h>
#include "mastermind.h"
#include "lcd_wrapper.h"
void setup() {
// put your setup code here, to run once:
lcd_init();
}
void loop() {
// put your main code here, to run repeatedly:
delay(1000);
lcd_print_at(1,0,"pls just work");
lcd_clear();
}
And here is the .h file that i made:
#include <Arduino.h>
#include <LiquidCrystal.h>
#include <LiquidCrystal_I2C.h>
#include "lcd_wrapper.h"
void lcd_init(){
lcd.init(); // initialize the lcd
lcd.init();
// Print a message to the LCD.
lcd.backlight();
}
void lcd_clear(){
lcd.clear();
}
void lcd_set_cursor(int y, int x){
lcd.setCursor(x,y);
}
void lcd_print(char* text){
Serial.println(text);
}
void lcd_print_at(int y, int x, char* text){
lcd_set_cursor(y, x);
lcd_print(text);
}
but i must be doing somerhing wrong bcs it is posting this error:
sketch\lcd_wrapper.cpp: In function 'void lcd_init()':
lcd_wrapper.cpp:9:3: error: 'lcd' was not declared in this scope
lcd.init(); // initialize the lcd
^~~
sketch\lcd_wrapper.cpp: In function 'void lcd_clear()':
lcd_wrapper.cpp:16:3: error: 'lcd' was not declared in this scope
lcd.clear();
^~~
sketch\lcd_wrapper.cpp: In function 'void lcd_set_cursor(int, int)':
lcd_wrapper.cpp:21:3: error: 'lcd' was not declared in this scope
lcd.setCursor(x,y);
^~~
exit status 1
'lcd' was not declared in this scope
Ty for your help.