Using the Logitech 3D Pro Joystick to map direction for multiple motors

Hello Everyone, I need some help, please. Right now I'm using the le3dp program to control the Logitech 3D Pro Joystick. I can get feedback from the device through the serial monitor. I just do not know where I put my code for my motors and how to establish directions using the map function.

Thanks in advance.

What kind of feedback and what types of motors?

In my serial monitor, I can see the joystick values change when the joystick is moved and its buttons are pressed. I'm using brushless motors that are connected to modified ESCs. I'm not sure if I should use the map function. When the joystick is moved, I want the speed of the motor to correlate with the angle of the joystick. (when the joystick is positioned all the way left, I want specific motors to be at full speed. the closer the joystick is to the dead zone, the slower I want the motors to be. )I'm trying to have all the motors stop when the joystick is not being touched.

"I'm using brushless motors that are connected to modified ESCs"

Do the ESCs normally get typical RC servo control commands? If so, then the incoming joystick values probably can be mapped to servo control values. Maybe check the servo "knob" example code.

Yes, I'm using a servo.write command. Would this code be placed in the cpp file? Also if I wanted to have a dead zone, would I just take this into consideration when I'm placing values in the array? Or would I need to have a separate declaration of the dead zone?

You say you're using servo.write()...but you don't know if it goes in a .cpp file. So presumably that means you're NOT using servo.write() but you're maybe thinking of using it.

What dead zone? What array?

It's about time we saw some code so we have something to help with. Please post the code you are currently using and include any servo.write() commands you think you might need (hint they go in the .ino file, probably shortly after you are currently printing values to Serial monitor).

Steve

Here are the le3dp files I’m using. I’ve watched multiple videos and people have been putting their main motor code in different files. Overall, I’m trying to ask if my moto code would go into the void loop in the ino file? If so what do the other files do? I just don’t know where to start if that makes more sense.

le3dp.ino (1.07 KB)

le3dp_rptparser.cpp (1.18 KB)

le3dp_rptparser.h (861 Bytes)