Here's the code that I found relevant for my project. When I verify this I get the error "'KEY_LEFT_CTRL' was not declared in this scope". I want to start testing out the code on my new arduino feather. Thanks for the help.
// use this option for OSX:
// char ctrlKey = KEY_LEFT_GUI;
// use this option for Windows and Linux:
char ctrlKey = KEY_LEFT_CTRL;
void setup() {
// make pin 2 an input and turn on the
// pullup resistor so it goes high unless
// connected to ground:
pinMode(2, INPUT_PULLUP);
// initialize control over the keyboard:
Keyboard.begin();
}
void loop() {
while (digitalRead(2) == HIGH) {
// do nothing until pin 2 goes low
delay(500);
}
delay(1000);
// new document:
Keyboard.press(ctrlKey);
Keyboard.press('n');
delay(100);
Keyboard.releaseAll();
// wait for new window to open:
delay(1000);
}
Your compiles (after adding the include) if you select the correct board in the tools menu. I don't have boards that support HID but just picked a Leonardo and it compiled. Hence the question in my previous post which board you are using.
Still unsolved. here's the code I'm working with currently:
#include <Keyboard.h>
char ctrlKey = KEY_LEFT_CTRL;
void setup() {
// make pin 2 an input and turn on the
// pullup resistor so it goes high unless
// connected to ground:
pinMode(2, INPUT_PULLUP);
// initialize control over the keyboard:
Keyboard.begin();
}
void loop() {
while (digitalRead(2) == HIGH) {
// do nothing until pin 2 goes low
delay(500);
}
delay(1000);
// new document:
Keyboard.press(ctrlKey);
Keyboard.press('n');
delay(100);
Keyboard.releaseAll();
// wait for new window to open:
delay(1000);
}
No experience with Feathers; only thing I can say is to make sure that you pick the correct board from the toold menu (and as said, compiling for Uno will not work).