I am making a project on tinkercad and later in real life but it just keeps giving invalid header file error is there anybody who can help?
thanks
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); // Set the LCD address to 0x27 for a 16 chars and 2 line display
const int buttonYesPin = 2; // Pin for the 'Yes' button
const int buttonNoPin = 3; // Pin for the 'No' button
const int motorPin = 8; // Pin for the DC motor
const int timerDuration = 420000; // 7 minutes in milliseconds
unsigned long startTime;
bool timerExpired = false;
void setup() {
pinMode(buttonYesPin, INPUT_PULLUP);
pinMode(buttonNoPin, INPUT_PULLUP);
pinMode(motorPin, OUTPUT);
lcd.init(); // Initialize the LCD
lcd.backlight(); // Turn on the backlight
lcd.print("Answer Yes or No"); // Display initial message
delay(2000);
lcd.clear();
startTime = millis(); // Start the timer
}
void loop() {
unsigned long currentTime = millis();
unsigned long elapsedTime = currentTime - startTime;
if (elapsedTime >= timerDuration) {
timerExpired = true;
}
if (!timerExpired) {
// Display questions here
// Check button presses and handle them
// Update LCD display accordingly
} else {
// Activate DC motor
digitalWrite(motorPin, HIGH);
// You can also display a message on the LCD indicating the timer expired
lcd.clear();
lcd.print("Time's up!");
while (true) {
// Loop indefinitely after timer expiry
}
}
}