Hi,
I'm working on a Arduino based macro keyboard to control a professional audio recorder. In this case, a Sound Devices Scorpio:
The recorder has an USB-A port for for peripherals and I can easily control it with a regular keyboard.
I've created a very simple setup using an Arduino Pro Micro and an example sketch from the library, and it works fine when connected to my computer.
However, the recorder doesn't detect the Arduino keyboard, as if there was nothing plugged in.
Is there something in my code that I should try, such as other keyboard or HID library?
Or maybe another board with a different chip?
Any help is much appreciated!
Thanks, Luis
- Hardware: Arduino (compatible) Pro Micro
- Arduino IDE 1.8.12
/*
Keyboard Message test
For the Arduino Leonardo and Micro.
Sends a text string when a button is pressed.
The circuit:
- pushbutton attached from pin 4 to +5V
- 10 kilohm resistor attached from pin 4 to ground
created 24 Oct 2011
modified 27 Mar 2012
by Tom Igoe
modified 11 Nov 2013
by Scott Fitzgerald
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/KeyboardMessage
*/
#include "Keyboard.h"
const int buttonPin = 4; // input pin for pushbutton
int previousButtonState = HIGH; // for checking the state of a pushButton
int counter = 0; // button push counter
void setup() {
// make the pushButton pin an input:
pinMode(buttonPin, INPUT);
// initialize control over the keyboard:
Keyboard.begin();
}
void loop() {
// read the pushbutton:
int buttonState = digitalRead(buttonPin);
// if the button state has changed,
if ((buttonState != previousButtonState)
// and it's currently pressed:
&& (buttonState == HIGH)) {
// increment the button counter
counter++;
// type out a message
Keyboard.press(KEY_UP_ARROW);
delay(100);
Keyboard.releaseAll();
}
// save the current button state for comparison next time:
previousButtonState = buttonState;
}