Using SpaceNavigator with Arduino?
Moderator: Moderators
Using SpaceNavigator with Arduino?
Hello,
Is it possible to connect the SpaceNavigator directly to a Arduino board without using a computer and the 3Dconnexion SDK as interface?
Thanks!
/Andreas
Is it possible to connect the SpaceNavigator directly to a Arduino board without using a computer and the 3Dconnexion SDK as interface?
Thanks!
/Andreas
Re: Using SpaceNavigator with Arduino?
Hi Andreas,
This would be a very cool project but we're not very familiar with the Arduino.
As far as I understand, the USB port on the Arduino is used to set up a serial connection to the programming host. You would need to be able to have a "USB host" capability in the Arduino board to get data directly from the 3D mouse.
One possible alternative, is to use the Raspberry Pi board as it has USB host capabilities (and it should be fairly doable to interface with other Arduino hardware).
This would be a very cool project but we're not very familiar with the Arduino.
As far as I understand, the USB port on the Arduino is used to set up a serial connection to the programming host. You would need to be able to have a "USB host" capability in the Arduino board to get data directly from the 3D mouse.
One possible alternative, is to use the Raspberry Pi board as it has USB host capabilities (and it should be fairly doable to interface with other Arduino hardware).
Re: Using SpaceNavigator with Arduino?
Hello,
it is possible to connect a HID device to an arduino board (e.g. Arduino Mega 2560) using a "usb shield" (e. g. the USB Shield 2.0 by circuitsathome http://www.circuitsathome.com/products- ... r-arduino/).
In combination with a joystick (e.g. Logitech Extreme 3D Pro) this works very well.
The problem I have is to define a DataEvent for the SpaceNavigator.
The working DataEvent for the joystick:
struct GamePadEventData
{
union { //axes and hut switch
uint32_t axes;
struct {
uint32_t x : 10;
uint32_t y : 10;
uint32_t hat : 4;
uint32_t twist : 8;
};
};
uint8_t buttons_a;
uint8_t slider;
uint8_t buttons_b;
};
How to define the DataEvent für the SpaceNavigator?
Thanks for any advice!
Michael
it is possible to connect a HID device to an arduino board (e.g. Arduino Mega 2560) using a "usb shield" (e. g. the USB Shield 2.0 by circuitsathome http://www.circuitsathome.com/products- ... r-arduino/).
In combination with a joystick (e.g. Logitech Extreme 3D Pro) this works very well.
The problem I have is to define a DataEvent for the SpaceNavigator.
The working DataEvent for the joystick:
struct GamePadEventData
{
union { //axes and hut switch
uint32_t axes;
struct {
uint32_t x : 10;
uint32_t y : 10;
uint32_t hat : 4;
uint32_t twist : 8;
};
};
uint8_t buttons_a;
uint8_t slider;
uint8_t buttons_b;
};
How to define the DataEvent für the SpaceNavigator?
Thanks for any advice!
Michael
Re: Using SpaceNavigator with Arduino?
Most 3Dx devices send motion data in two packets. The first byte of the packet is a muxing byte that determines which packet it is. 1 for translations; 2 for rotations; 3 for buttons, etc. Some newer devices send all motion the data in one translation packet--your code should be prepared to handle both.
The muxing byte is followed by 3 double byte values (or 6 double bytes) of axis data. The axis data is in X, Y, Z order, little endian.
For the long packets, you get Tx, Ty, Tz, Rx, Ry, Rz. You know which packet it is by the length (7 or 13).
The muxing byte is followed by 3 double byte values (or 6 double bytes) of axis data. The axis data is in X, Y, Z order, little endian.
For the long packets, you get Tx, Ty, Tz, Rx, Ry, Rz. You know which packet it is by the length (7 or 13).
Re: Using SpaceNavigator with Arduino?
Thanks a lot for this hint! I'll try my very best
Best regards!
Michael

Best regards!
Michael
Re: Using SpaceNavigator with Arduino?
Hello Michael!
Did you get the USB Shield 2.0 to work with SpaceNavigator?
Thanks!
/Andreas
Did you get the USB Shield 2.0 to work with SpaceNavigator?
Thanks!
/Andreas
Re: Using SpaceNavigator with Arduino?
Yes, it's working!
I 'm going to purge my code and post it here!
Best regards!
Michael

I 'm going to purge my code and post it here!
Best regards!
Michael
Re: Using SpaceNavigator with Arduino?
Here is the code ...
Arduino files for usb host shield 2.0 and SpaceNavigator
Have fun!
Michael
Arduino files for usb host shield 2.0 and SpaceNavigator
Have fun!
Michael
- Attachments
-
- USB_SpaceNavigator.rar
- Arduino files for usb host shield 2.0 and SpaceNavigator
- (2.2 KiB) Downloaded 1549 times
Re: Using SpaceNavigator with Arduino?
The line that reads "JoystickEvents JoyEvents;" is troubling my Arduino. What does this line call for to run?