You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

le3dp.ino 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* Simplified Logitech Extreme 3D Pro Joystick Report Parser */
  2. #include <hid.h>
  3. #include <hiduniversal.h>
  4. #include <usbhub.h>
  5. #include "le3dp_rptparser.h"
  6. // Satisfy the IDE, which needs to see the include statment in the ino too.
  7. #ifdef dobogusinclude
  8. #include <spi4teensy3.h>
  9. #include <SPI.h>
  10. #endif
  11. USB Usb;
  12. USBHub Hub(&Usb);
  13. HIDUniversal Hid(&Usb);
  14. JoystickEvents JoyEvents;
  15. JoystickReportParser Joy(&JoyEvents);
  16. void setup()
  17. {
  18. Serial.begin( 115200 );
  19. #if !defined(__MIPSEL__)
  20. while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
  21. #endif
  22. Serial.println("Start");
  23. if (Usb.Init() == -1)
  24. Serial.println("OSC did not start.");
  25. delay( 200 );
  26. if (!Hid.SetReportParser(0, &Joy))
  27. ErrorMessage<uint8_t>(PSTR("SetReportParser"), 1 );
  28. }
  29. void loop()
  30. {
  31. Usb.Task();
  32. }