Hi. So I wonder how to do it, because I have plugged in ps3 controller and what I want to do is to retransmit to usb serial, if that makes any sense, because I haven't done anything with usb protocol. And I'm trying this code and rawHid gets nothing. Is RawHIDController something different what I think it is ? Like some kind of special device, instead of abstraction for reading raw hid data from device ?
C++:
#include "USBHost_t36.h"
USBHost myusb;
USBHub hub1(myusb);
USBHIDParser hid1(myusb);
RawHIDController rawhid1(myusb);
JoystickController joystick(myusb);
void setup() {
Serial1.begin(2000000);
while (!Serial) ; // wait for Arduino Serial Monitor
Serial.println("\n\nUSB Host Joystick Testing");
rawhid1.attachReceive(OnReceiveHidData);
myusb.begin();
}
void loop() {
myusb.Task();
const uint8_t *psz = joystick.manufacturer();
if (psz && *psz) Serial.printf(" joystick manufacturer: %s\n", psz);
const uint8_t *psz2 = rawhid1.manufacturer();
if (psz2 && *psz2) Serial.printf(" raw manufacturer: %s\n", psz);
delay(50);
}
bool OnReceiveHidData(uint32_t usage, const uint8_t *data, uint32_t len) {
Serial.printf("OnReceiveHidData");
return true;
}
Last edited: