So, I was originally using a Arduino Leonardo and this code worked just fine but right as i switch to a nano is goes beserk and tells me "keyboard" is not included. I need help figuring out what i need to fix or add
dcs-bios-arduino-library-0.2.11 (1).zip (24.5 KB) --This is the libary for DCS Bios if needed
#include "Keyboard.h"
#define DCSBIOS_IRQ_SERIAL
#include "DcsBios.h"
boolean states[] = {false, false, false, false, false, false, false, false, false, false, false, false, false, false};
char hotkeysOn[] = {'g', 'c', 'q', 'a', 'b', 'w', 'd', 'l', 's', 'j', 'k', 'm', 'x'};
char hotkeysOff[] = {'g', 'c', 'q', 'a', 'b', 'w', 'd', 'l', 's', 'j', 'k', 'm', 'x'};
void setup() {
DcsBios::setup();
for (int i = 0; i <= 13; i++) {
pinMode(i, INPUT);
}
Keyboard.begin();
Serial.begin(9600);
}
void loop() {
DcsBios::loop()
for (int i = 0; i <= 13; i++) {
if (digitalRead(i) == HIGH && !states[i]) {
states[i] = !states[i];
Keyboard.write(hotkeysOn[i]);
if(i==12){
Keyboard.write(hotkeysOn[i]);
Keyboard.write(hotkeysOn[i]);
}
}
else if (digitalRead(i) == LOW && states[i]) {
states[i] = !states[i];
Keyboard.write(hotkeysOff[i]);
}
}
delay(10);
}