I want to add a windows key to my buttib pres but I get this error message:
Arduino: 1.6.6 (Windows 10), Board: "Arduino/Genuino Uno"
C:\Users[USER]\AppData\Local\Temp\arduino_d35f905a4032897f9105e20889ab986a\Spotify.ino: In function 'void setup()':
Spotify:17: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
Keyboard.begin();
^
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"
enabled in File > Preferences.
const int next = 13;
const int pause = 12;
const int pref = 11;
#include <Keyboard.h>
const int rood = 10;
const int groen = 9;
const int oranje = 8;
int nextState = 0;
int prefState = 0;
int pauzeState = 0;
void setup() {
buttonSetup();
ledSetup();
Serial.begin(9600);
Keyboard.begin();
}
void loop() {
nextState = digitalRead(next);
prefState = digitalRead(pref);
pauzeState = digitalRead(pause);
deIf(nextState,groen);
deIf(prefState,oranje);
deIf(pauzeState,rood);
}
void deIf(int state, int led){
if (state == HIGH) {
digitalWrite(led,LOW);
} else {
digitalWrite(led,HIGH);
}
}
void buttonSetup(){
for (int i = 10;i < 14; i ++){
pinMode(i,INPUT);
}
}
void ledSetup(){
for (int i = 7;i < 11; i ++){
pinMode(i,OUTPUT);
}
}