I have, in fact i’ve used this code to write letters for another project. I just cant get the two to merge together.
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);
pinMode(4, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
pinMode(8, INPUT_PULLUP);
pinMode(10, INPUT_PULLUP);
pinMode(12, INPUT_PULLUP);
Keyboard.begin();
}
void loop() {
//if the button is pressed
if(digitalRead(2)==LOW){
//Send an ASCII '1',
Keyboard.press('1');
delay(125);
Keyboard.release('1');
delay(100);
}
//if the button is pressed
if(digitalRead(4)==LOW){
//Send an ASCII '3',
Keyboard.press('3');
delay(125);
Keyboard.release('3');
delay(100);
}
//if the button is pressed
if(digitalRead(6)==LOW){
//Send an ASCII '4',
Keyboard.press('4');
delay(125);
Keyboard.release('4');
delay(100);
}
//if the button is pressed
if(digitalRead(8)==LOW){
//Send an ASCII '6',
Keyboard.press('6');
delay(125);
Keyboard.release('6');
delay(100);
}
//if the button is pressed
if(digitalRead(10)==LOW){
//Send an ASCII '7',
Keyboard.press('7');
delay(125);
Keyboard.release('7');
delay(100);
}
//if the button is pressed
if(digitalRead(12)==LOW){
//Send an ASCII '9',
Keyboard.press('9');
delay(125);
Keyboard.release('9');
delay(100);
}
}