So I've been trying to use Mouse.move(); and Keyboard.press();. Every time I try to send it to my Arduino(mega 2560) it says keyboard or mouse was not declared. Any solutions?
#include <Keyboard.h>
void setup() {
pinMode(2, INPUT);
}
void loop() {
if (digitalRead(2) == HIGH) {
Keyboard.begin();
Keyboard.press(KEY_LEFT_ARROW);
}
if(digitalRead(2)==LOW){
Keyboard.end();
}
}