Jakub Evans
Member
Hey folks,
I'm attempting to connect a keyboard to my teensy 4.1, but it doesn't seem to recognize it for some reason.
To begin, I'm quite certain that I connected the GND, +5V, D-, and D+ pins correctly (I even attempted inverting D- and D+ just in case).
And I'm running my tests with the code below.
I also uncommented the following in order to display debug information.
Anyway, when I run the program, I get this at first:
Then when I connect the keyboard, the following shows up:
And that's pretty much it. (To be honest I'm not sure what to expect in the debug logs, so maybe its totally normal)
I tried running the HIDDeviceInfo example to check if it was just me misusing the library, but it too doesn't find any devices (I tried a lot of different usb devices btw, ranging from usb sticks, keyboards, mouses, etc..)
I'm attempting to connect a keyboard to my teensy 4.1, but it doesn't seem to recognize it for some reason.
To begin, I'm quite certain that I connected the GND, +5V, D-, and D+ pins correctly (I even attempted inverting D- and D+ just in case).
And I'm running my tests with the code below.
Code:
#include "Arduino.h"
#include "USBHost_t36.h"
USBHost host;
KeyboardController keyboard(host);
void setup() {
Serial.begin(115200);
while (!Serial);
USBHost::begin();
keyboard.attachPress([](int key) {
Serial.print("Pressed ");
Serial.println((char) key);
});
}
void loop() {
USBHost::Task();
delay(1000);
}
I also uncommented the following in order to display debug information.
Code:
#define USBHOST_PRINT_DEBUG
Anyway, when I run the program, I get this at first:
Code:
USB2 PLL running
reset waited 6
USBHS_ASYNCLISTADDR = 0
USBHS_PERIODICLISTBASE = 20003000
periodictable = 20003000
Then when I connect the keyboard, the following shows up:
Code:
port change: 10001803
connect
begin reset
port change: 10001005
port enabled
end recovery
new_Device: 12 Mbit/sec
new_Pipe
And that's pretty much it. (To be honest I'm not sure what to expect in the debug logs, so maybe its totally normal)
I tried running the HIDDeviceInfo example to check if it was just me misusing the library, but it too doesn't find any devices (I tried a lot of different usb devices btw, ranging from usb sticks, keyboards, mouses, etc..)