Hi, I have recently bought a Teensy 4.1 and tried to use the USB Host capability of the board.
I have not bought the official cable for the board and instead bought a normal female USB A to microUSB cable and stripped it to get the 4 wires inside. I connected red wire to 5V, white wire to D-, green wire to D+, and black to the GND on the board.
The problem I am having is that I get the power to the mouse (the LEDs and sensor turn on), but I get no data sent.
The Teensy 4.1 code I use:
Debug data I get from enabling debug info in "USBHost_t36.h":
I have not bought the official cable for the board and instead bought a normal female USB A to microUSB cable and stripped it to get the 4 wires inside. I connected red wire to 5V, white wire to D-, green wire to D+, and black to the GND on the board.
The problem I am having is that I get the power to the mouse (the LEDs and sensor turn on), but I get no data sent.
The Teensy 4.1 code I use:
C++:
#include "USBHost_t36.h"
USBHost usb_host;
MouseController mouse(usb_host);
void setup() {
Serial.begin(115200);
usb_host.begin();
}
void loop() {
usb_host.Task();
if (mouse.available())
{
Serial.println("mouse input");
mouse.mouseDataClear();
}
}
Debug data I get from enabling debug info in "USBHost_t36.h":
Code:
USB2 PLL running
reset waited 6
USBHS_ASYNCLISTADDR = 0
USBHS_PERIODICLISTBASE = 20003000
periodictable = 20003000
Last edited: