I need help I can't use Keyboard.write() here is my code
#include <HID.h>
#include <Keyboard.h>
void setup() {
// put your setup code here, to run once:
//Setting up Digital Pins
pinMode(2, INPUT);
pinMode(3, INPUT);
pinMode(4, INPUT);
pinMode(5, INPUT);
pinMode(6, INPUT);
pinMode(7, INPUT);
pinMode(8, INPUT);
pinMode(9, INPUT);
pinMode(10, INPUT);
pinMode(11, INPUT);
pinMode(12, INPUT);
pinMode(13, INPUT);
// setting up Analog Pins to Digital
pinMode(A0,INPUT);
pinMode(A1,INPUT);
pinMode(A2,INPUT);
pinMode(A3,INPUT);
pinMode(A4,INPUT);
pinMode(A5,INPUT);
Keyboard.begin();
}
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(13) == LOW) {Keyboard.write(113);}
}
Keyboard.end();
here is the error output
Arduino: 1.8.7 (Windows 10), Board: "Arduino/Genuino Uno"
In file included from C:\Users\manue\Documents\My Arduino Sketches\Mandar_Keyboard_Keys_Ardunino\Mandar_Keyboard_Keys_Ardunino.ino:3:0:
C:\Program Files\Arduino\libraries\Keyboard\src/Keyboard.h:29:2: warning: #warning "Using legacy HID core (non pluggable)" [-Wcpp]
#warning "Using legacy HID core (non pluggable)"
^
C:\Users\manue\Documents\My Arduino Sketches\Mandar_Keyboard_Keys_Ardunino\Mandar_Keyboard_Keys_Ardunino.ino: In function 'void setup()':
Mandar_Keyboard_Keys_Ardunino:30:1: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
Keyboard.begin();
^
C:\Users\manue\Documents\My Arduino Sketches\Mandar_Keyboard_Keys_Ardunino\Mandar_Keyboard_Keys_Ardunino.ino: In function 'void loop()':
Mandar_Keyboard_Keys_Ardunino:37:32: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
if (digitalRead(13) == LOW) {Keyboard.write(113);}
^
C:\Users\manue\Documents\My Arduino Sketches\Mandar_Keyboard_Keys_Ardunino\Mandar_Keyboard_Keys_Ardunino.ino: At global scope:
Mandar_Keyboard_Keys_Ardunino:41:1: error: 'Keyboard' does not name a type
Keyboard.end();
^
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.