You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Logitech Cordless Joystick Freedom 2.4" is not working with "BenBrewerBowman/Arduino_Logitech_3D_Joystick Library", would you help how to solve it please ? thank you.
#1
Open
mekaci89 opened this issue
Dec 10, 2017
· 1 comment
BenBrewerBowman, firstly thank you very much for providing such a library that we can access to joystick values in arduino sketch too.
I am using "USB Host Shield 2.0 Library" and your Arduino_Logitech_3D_Joystick Library to use my "Logitech 3D PRO Extreme" joystick and everything is working nicely. But I was experienced some problem while using nrf24 wireless communication between two arduino devices.
After that, I found a wireless joystick on internet from logitech company and it is similar too "Logitech 3D PRO Extreme Joystick". It's name is "Logitech Cordless Joystick Freedom 2.4".
"Logitech Cordless Joystick Freedom 2.4" is very old joystick and it is the only wireless joystick of its own kind too, I hardly found it on ebay already.
This "Logitech Cordless Joystick Freedom 2.4" is working with "USB Host Shield 2.0 Library"s USBHIDJoystick example sketch; but "Logitech Cordless Joystick Freedom 2.4" is not working with your BenBrewerBowman/Arduino_Logitech_3D_Joystick Library. I don't know why I don't get any reading on serial monitor.
I looked into the USBHIDJoystick example sketch and its cpp, header files and the code written there is more complex than yours; so I failed to modify :(
If it is possible would you make modification on this sketch and its cpp and header files please to access joystick values inside of arduino sketch too ? Then we can use this wireless logitech joystick too.
"USB Host Shield 2.0 Library"s USBHIDJoystick example
// Satisfy IDE, which only needs to see the include statment in the ino.
#ifdef dobogusinclude
#include <spi4teensy3.h>
#endif
#include <SPI.h>
#include "hidjoystickrptparser.h"
USB Usb;
USBHub Hub(&Usb);
HIDUniversal Hid(&Usb);
JoystickEvents JoyEvents;
JoystickReportParser Joy(&JoyEvents);
void setup() {
Serial.begin(115200);
#if !defined(MIPSEL)
while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
#endif
Serial.println("Start");
if (Usb.Init() == -1)
Serial.println("OSC did not start.");
delay(200);
if (!Hid.SetReportParser(0, &Joy))
ErrorMessage<uint8_t > (PSTR("SetReportParser"), 1);
Can you create a pull request with your change? If so I would be happy to integrate it into this repository. This is kind of an old project, and I am sure that the USB 2.0 hosting library has received some updates that this project might not support.
BenBrewerBowman, firstly thank you very much for providing such a library that we can access to joystick values in arduino sketch too.
I am using "USB Host Shield 2.0 Library" and your Arduino_Logitech_3D_Joystick Library to use my "Logitech 3D PRO Extreme" joystick and everything is working nicely. But I was experienced some problem while using nrf24 wireless communication between two arduino devices.
After that, I found a wireless joystick on internet from logitech company and it is similar too "Logitech 3D PRO Extreme Joystick". It's name is "Logitech Cordless Joystick Freedom 2.4".
"Logitech Cordless Joystick Freedom 2.4" is very old joystick and it is the only wireless joystick of its own kind too, I hardly found it on ebay already.
This "Logitech Cordless Joystick Freedom 2.4" is working with "USB Host Shield 2.0 Library"s USBHIDJoystick example sketch; but "Logitech Cordless Joystick Freedom 2.4" is not working with your BenBrewerBowman/Arduino_Logitech_3D_Joystick Library. I don't know why I don't get any reading on serial monitor.
I looked into the USBHIDJoystick example sketch and its cpp, header files and the code written there is more complex than yours; so I failed to modify :(
If it is possible would you make modification on this sketch and its cpp and header files please to access joystick values inside of arduino sketch too ? Then we can use this wireless logitech joystick too.
"USB Host Shield 2.0 Library"s USBHIDJoystick example
USBHIDJoystick example sketch:
`#include <usbhid.h>
#include <hiduniversal.h>
#include <usbhub.h>
// Satisfy IDE, which only needs to see the include statment in the ino.
#ifdef dobogusinclude
#include <spi4teensy3.h>
#endif
#include <SPI.h>
#include "hidjoystickrptparser.h"
USB Usb;
USBHub Hub(&Usb);
HIDUniversal Hid(&Usb);
JoystickEvents JoyEvents;
JoystickReportParser Joy(&JoyEvents);
void setup() {
Serial.begin(115200);
#if !defined(MIPSEL)
while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
#endif
Serial.println("Start");
}
void loop() {
Usb.Task();
}
USBHIDJoystick example sketch's cpp file:
#include "hidjoystickrptparser.h"JoystickReportParser::JoystickReportParser(JoystickEvents *evt) :
joyEvents(evt),
oldHat(0xDE),
oldButtons(0) {
for (uint8_t i = 0; i < RPT_GEMEPAD_LEN; i++)
oldPad[i] = 0xD;
}
void JoystickReportParser::Parse(USBHID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) {
bool match = true;
}
void JoystickEvents::OnGamePadChanged(const GamePadEventData *evt) {
Serial.print("X1: ");
PrintHex<uint8_t > (evt->X, 0x80);
Serial.print("\tY1: ");
PrintHex<uint8_t > (evt->Y, 0x80);
Serial.print("\tX2: ");
PrintHex<uint8_t > (evt->Z1, 0x80);
Serial.print("\tY2: ");
PrintHex<uint8_t > (evt->Z2, 0x80);
Serial.print("\tRz: ");
PrintHex<uint8_t > (evt->Rz, 0x80);
Serial.println("");
}
void JoystickEvents::OnHatSwitch(uint8_t hat) {
Serial.print("Hat Switch: ");
PrintHex<uint8_t > (hat, 0x80);
Serial.println("");
}
void JoystickEvents::OnButtonUp(uint8_t but_id) {
Serial.print("Up: ");
Serial.println(but_id, DEC);
}
void JoystickEvents::OnButtonDn(uint8_t but_id) {
Serial.print("Dn: ");
Serial.println(but_id, DEC);
}`
USBHIDJoystick example sketch's header file:
`#if !defined(HIDJOYSTICKRPTPARSER_H)
#define HIDJOYSTICKRPTPARSER_H
#include <usbhid.h>
struct GamePadEventData {
uint8_t X, Y, Z1, Z2, Rz;
};
class JoystickEvents {
public:
virtual void OnGamePadChanged(const GamePadEventData *evt);
virtual void OnHatSwitch(uint8_t hat);
virtual void OnButtonUp(uint8_t but_id);
virtual void OnButtonDn(uint8_t but_id);
};
#define RPT_GEMEPAD_LEN 5
class JoystickReportParser : public HIDReportParser {
JoystickEvents *joyEvents;
public:
JoystickReportParser(JoystickEvents *evt);
};
#endif // HIDJOYSTICKRPTPARSER_H`
If anyone has deep knowledge about this "how to make that modification, please would you help ? thank you very much.
The text was updated successfully, but these errors were encountered: