String command;
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
void setup() {
Serial.begin(9600);
lcd.backlight();
lcd.init();
delay(2000);
Serial.println("Ai Chat assistant is on!");
}
void loop() {
if (Serial.available()) {
command = Serial.readStringUntil('\n');
command.trim();
if (command.equals("I need help"))
{
lcd.clear();
lcd.setCursor(0,0);
lcd.println("Sure what is it?");
}
if (command.equals("What is 1+1"))
{
lcd.clear();
lcd.setCursor(5,0);
lcd.println(1+1);
}
if (command.equals("Thanks") || command.equals("Thx") || command.equals("Thank you"))
{
lcd.clear();
lcd.setCursor(0,0);
lcd.println("No problem.");
}
}
}