I trying to use my MKR Zero as a keyboard(specifically adding F1-F12 and voliume buttone. When i try to press any buttons, nothing happens. Not even resseting the board works. After going into my computer settings and checking the device properties ive determined tht the driver im using isnt responding. Is there something wrong with the board? or is there something else wrong. I got the board off arduino's amazon page.
images showing the issue are attached, Here's the code im using:
//Board used: ARDUINO MKR ZERO
#include <Keyboard.h>
#define KEY_F1 0xC2
#define KEY_F2 0xC3
#define KEY_F3 0xC4
#define KEY_F4 0xC5
#define KEY_F5 0xC6
#define KEY_F6 0xC7
#define KEY_F7 0xC8
#define KEY_F8 0xC9
#define KEY_F9 0xCA
#define KEY_F10 0xCB //Keys being programmed
#define KEY_F11 0xCC
#define KEY_F12 0xCD
#define KEY_MUTE 0x7F
#define KEY_VOLUMEUP 0x80
#define KEY_VOLUMEDOWN 0x81
int F1 = 1;
int F2 = 2;
int F3 = 3;
int F4 = 4;
int F5 = 5;
int F6 = 6;
int F7 = 7;
int F8 = 8;
int F9 = 9;
int F10 = 10;
int F11 = 11;
int F12 = 12;
int VolMute = 16;
int VolUp = 17;
int VolDown = 18;
void setup() {
Keyboard.begin();
pinMode(F1, INPUT);
pinMode(F2, INPUT);
pinMode(F3, INPUT);
pinMode(F4, INPUT);
pinMode(F5, INPUT);
pinMode(F6, INPUT);
pinMode(F7, INPUT);
pinMode(F8, INPUT);
pinMode(F9, INPUT);
pinMode(F10, INPUT);
pinMode(F11, INPUT);
pinMode(F12, INPUT);
pinMode(VolMute, INPUT);
pinMode(VolUp, INPUT);
pinMode(VolDown, INPUT);
pinMode(LED_BUILTIN, OUTPUT); //Helps me see that the board is working
digitalWrite(LED_BUILTIN, HIGH);
}
void loop() {
if (F1 == HIGH){
Keyboard.press(KEY_F1);
delay(30);
Keyboard.release(KEY_F1);
}
else if (F2 == HIGH){
Keyboard.press(KEY_F2);
delay(30);
Keyboard.release(KEY_F2);
}
else if (F3 == HIGH){
Keyboard.press(KEY_F3);
delay(30);
Keyboard.release(KEY_F3);
}
else if (F4 == HIGH){
Keyboard.press(KEY_F4);
delay(30);
Keyboard.release(KEY_F4);
}
else if (F5 == HIGH){
Keyboard.press(KEY_F5);
delay(30);
Keyboard.release(KEY_F5);
}
else if (F6 == HIGH){
Keyboard.press(KEY_F6);
delay(30);
Keyboard.release(KEY_F6);
}
else if (F7 == HIGH){
Keyboard.press(KEY_F7);
delay(30);
Keyboard.release(KEY_F7);
}
else if (F8 == HIGH){
Keyboard.press(KEY_F8);
delay(30);
Keyboard.release(KEY_F8);
}
else if (F9 == HIGH){
Keyboard.press(KEY_F9);
delay(30);
Keyboard.release(KEY_F9);
}
else if (F10 == HIGH){
Keyboard.press(KEY_F10);
delay(30);
Keyboard.release(KEY_F10);
}
else if (F11 == HIGH){
Keyboard.press(KEY_F11);
delay(30);
Keyboard.release(KEY_F11);
}
else if (F12 == HIGH){
Keyboard.press(KEY_F12);
delay(30);
Keyboard.release(KEY_F12);
}
else if (VolUp == HIGH){
Keyboard.press(KEY_VOLUMEUP);
delay(30);
Keyboard.release(KEY_VOLUMEUP);
}
else if (VolDown == HIGH){
Keyboard.press(KEY_VOLUMEDOWN);
delay(30);
Keyboard.release(KEY_VOLUMEDOWN);
}
else if (VolMute == HIGH){
Keyboard.press(KEY_MUTE);
delay(30);
Keyboard.release(KEY_MUTE);
}
}
ill need to rewire this thing, my main issue is that the driver for my mkr zero isnt working. if you need to see, i have images uploaded to the original post