26 lines
466 B
C++
26 lines
466 B
C++
#include "EspUsbHost.h"
|
|
|
|
class MyEspUsbHost : public EspUsbHost {
|
|
void onKeyboardKey(uint8_t ascii, uint8_t keycode, uint8_t modifier) {
|
|
if (' ' <= ascii && ascii <= '~') {
|
|
Serial.printf("%c", ascii);
|
|
} else if (ascii == '\r') {
|
|
Serial.println();
|
|
}
|
|
};
|
|
};
|
|
|
|
MyEspUsbHost usbHost;
|
|
|
|
void setup() {
|
|
Serial.begin(115200);
|
|
delay(500);
|
|
|
|
usbHost.begin();
|
|
usbHost.setHIDLocal(HID_LOCAL_Japan_Katakana);
|
|
}
|
|
|
|
void loop() {
|
|
usbHost.task();
|
|
}
|