i am using the latest arduino software arduino 1.7.9, but i cant seem to compile a keyboard.h file. they are giving me this error.
Arduino: 1.7.9 (Windows 8.1), Board: "Arduino Leonardo"
Keyboard_input.ino:1:22: fatal error: Keyboard.h: No such file or directory
compilation terminated.
Error compiling.
Was trying to create a flex sensor glove to operate a normal racing game in the PC. I tried to test the coding by using a simple code that i found in the internet. but the error is stopping me from proceeding. Can i get a guidance here? thank you. these are my code:
#include <Keyboard.h>
const int flexPin1 = A0;
const int threshold1 = 712;
//Boolean used to initiate glove typing
boolean flexread = false;
void setup() {
//Analogue Setup:
pinMode(flexPin1,INPUT);
}
void loop() {
//obtain flex values
int flex1 = analogRead(flexPin1);
if (flexread == true){
//if thumb
while (flex1 > threshold1){
//Send an ASCII '0',
delay(300);
int flex1t = analogRead(flexPin1);
if (flex1t < flex1);{
Keyboard.write('9');
break;
}
}
}
else {
delay(20);
}
}
if there is any problem with the coding, please let me know. thankyou. i cant find the right coding to input the bend of the flex sensor into a keyboard button press.