Uhh, so here is my code:
#include <LiquidCrystal.h>
#include <DFR_LCD_Keypad.h>
#include <Keyboard.h>
LiquidCrystal lcd(8,9,4,5,6,7);
DFR_LCD_Keypad keypad(A0, &lcd);
int led=13;
int last_key, key;
void setup()
{
lcd.begin(16,2);
lcd.setCursor(0,0);
lcd.print("PRESS KEYS NOW");
pinMode(led, OUTPUT);
delay(1000);
lcd.clear();
Keyboard.begin();
}
void loop()
{
#include "Keyboard.h";
last_key = keypad.get_last_key();
key = keypad.read_key();
if (key != last_key) {
lcd.clear();
lcd.setCursor(0,0);
switch (key) {
case KEY_RIGHT:
lcd.print("RIGHT");
break;
case KEY_UP:
lcd.print("UP");
break;
case KEY_DOWN:
lcd.print("DOWN");
break;
case KEY_LEFT:
lcd.print("LEFT");
break;
case KEY_SELECT:
lcd.print("SELECT");
Keyboard.print("r");
digitalWrite(led, HIGH);
break;
case KEY_NONE:
default:
lcd.print("NO KEYS PRESSED");
lcd.setCursor(0,1);
lcd.print("PRESS KEYS NOW");
digitalWrite(led, LOW);
break;
}
}
delay(10);
}`
It says that it couldn't find "#include keyboard.h", this is the error message:
Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Arduino Uno"
C:\Users\Mini\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino: In function 'void setup()':
FINA14KITKJE85T:21:3: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
Keyboard.begin();
^~~~~~~~
C:\Users\Mini\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino:21:3: note: suggested alternative: 'keypad'
Keyboard.begin();
^~~~~~~~
keypad
C:\Users\Mini\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino: In function 'void loop()':
FINA14KITKJE85T:55:9: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
Keyboard.print("r");
^~~~~~~~
C:\Users\Mini\Downloads\FINA14KITKJE85T\FINA14KITKJE85T.ino:55:9: note: suggested alternative: 'keypad'
Keyboard.print("r");
^~~~~~~~
keypad
exit status 1
'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Anybody know what's wrong?