Using SpaceNavigator with Arduino?
Moderator: Moderators
Re: Using SpaceNavigator with Arduino?
I don't know anything about the CNC-Shield but it sounds like an interesting usage.
IIRC, the problem I had with the UNO was once I attached the USB shield, I ran out of pins to control my motors (too many used by the USB shield). Hopefully using proper shields eliminates that issue.
I would start by using the USB cable rather than complicate things with the wireless receiver.
The wireless receiver and SpaceMouse Wireless need to be paired. They should have been paired at the factory. I'd check them on a PC to make sure they are.
IIRC, the problem I had with the UNO was once I attached the USB shield, I ran out of pins to control my motors (too many used by the USB shield). Hopefully using proper shields eliminates that issue.
I would start by using the USB cable rather than complicate things with the wireless receiver.
The wireless receiver and SpaceMouse Wireless need to be paired. They should have been paired at the factory. I'd check them on a PC to make sure they are.
-
- Posts: 2
- Joined: Tue Sep 01, 2020 12:52 am
Re: Using SpaceNavigator with Arduino?
I used some code previously posted here (thank you mlkoch and DRogers96) for a project where I control a Mavic Mini using the SpaceMouse and an Arduino. Works like a charm, check it out here: https://forum.3dconnexion.com/viewtopic.php?f=8&t=36183
Re: Using SpaceNavigator with Arduino?
Hello,
I'm using a arduino uno, a usb host shield and the spacemouse with usb cable. The code is working but i can't see any values in the serial monitor? Anyone got an idea how i can see the values?
Thank you
I'm using a arduino uno, a usb host shield and the spacemouse with usb cable. The code is working but i can't see any values in the serial monitor? Anyone got an idea how i can see the values?
Thank you
DRogers96 wrote: ↑Mon Feb 10, 2020 6:16 pm Yep, that's what it was. I used a USB analyzer on my laptop to see all the data it was sending and saw there were a bunch of data packets that weren't being used by the Arduino code. I added six more variables to hold the six extra data packets that represent the rotation and was able to read the rotation data. The rotation packets are still in x-y-z order. Attached is the updated code (credits to mlkoch for the original code).
Re: Using SpaceNavigator with Arduino?
I forget what the serial monitor does, but the device does not send ASCII data, if that is what it is expecting.
Re: Using SpaceNavigator with Arduino?
What kind of data is it sending?
Re: Using SpaceNavigator with Arduino?
It sends USB packets. There is a ReportID in the first byte, then data following that varies with the type of report.
You have to parse it.
You probably just want the motion packet (6DOF) and the buttons packet.
I've put some code on github you can start with.
You have to parse it.
You probably just want the motion packet (6DOF) and the buttons packet.
I've put some code on github you can start with.
Re: Using SpaceNavigator with Arduino?
is there a link to that code?
Re: Using SpaceNavigator with Arduino?
I'm using the arduino code but still i can't see any data, do i need to add a LED screen or something like that?
Re: Using SpaceNavigator with Arduino?
There is a difference between some of the devices.
Older devices (SpaceNavigator) have two motion packets. One for Rotations. Another for Translations. Newer devices combine those into one packet. The code was written for the two packet models.
Print out what you get, at least the number of bytes in the packet. IIRC, it will be either 7 or 13.
And print out what you get from the buttons.
If you aren't getting anything, the electronics aren't working. The device may not be getting enough power to run.
Is the LED ring lit?
Older devices (SpaceNavigator) have two motion packets. One for Rotations. Another for Translations. Newer devices combine those into one packet. The code was written for the two packet models.
Print out what you get, at least the number of bytes in the packet. IIRC, it will be either 7 or 13.
And print out what you get from the buttons.
If you aren't getting anything, the electronics aren't working. The device may not be getting enough power to run.
Is the LED ring lit?
Re: Using SpaceNavigator with Arduino?
No (The blue light) it isn't lit, and i'm not getting any numbers
Re: Using SpaceNavigator with Arduino?
I have no idea.
Make sure you are not using a device that consumes too much power. Such as one that has an LCD.
Make sure you are not using a device that consumes too much power. Such as one that has an LCD.
Re: Using SpaceNavigator with Arduino?
how much power does the mouse need to work with the code?
Re: Using SpaceNavigator with Arduino?
Which device?