This time, I heard that I tried connecting GT Force on a PC. It's easy to use using the language Processing, so please give it a try. If the controller for the game becomes free to use, the things that can be done will expand. The content of this time was based on the information on the site of "Various self-made". I don't understand this library clearly either, so the explanation is insufficient. Please note that the content is about the size of the author's memo.
The GT Force used is for PS2 and is very old. When I looked it up, there was a description that this handle controller was not compatible with Windows 10, but when I used the one for GT Force Pro, I was able to use it safely with Windows 10. However, the pedal did not respond with the logitech setup software. I thought it was a malfunction, but it worked in a later program.
・ Windows10 64bit ・ Processing 3.5.3 ・ Game Control Plus 1.2.2 ・ GT Force LPRC-10000
Install the software for GT Force Pro from the Logitech support site. I recognized it just by inserting the USB into my computer without installing it, but I recommend it because it can be calibrated. When I pressed the button on the back right of the steering wheel when adjusting with software, the steering wheel went out of control and the rotation did not stop (laughs). There is no problem so far after re-stabbing. Logitech Support Site
First, start processing and install "Game Control Plus" from "Sketch"-> "Import Library"-> "Add Library" on the upper tab.
Check the sample data of "Game Control Plus" from "File"-> "Sample" on the upper tab. Select "Gcp_Configurator" and start it. Press the button to the left of the connected device name to open the details screen. You can check the operation of each button and lever there. GT Force recognized 6 buttons and 4 sliders. But of the four, the "Combined pedals" slider didn't respond. After confirming the operation, exit this program.
Next, the controller information is obtained by using the sample program in the same manner. This will be important in future programming. Select "Gcp_ShowDevices" from the "Game Control Plus" sample program you selected earlier and start it. In this program, you can check the names and numbers of sliders and buttons on the controller. The movement of the scroll bar of the program was unstable, but the following data was obtained without any problem. Record this information.
NAME : Logicool WingMan Formula Force GP USB
Type : Wheel
Port : Unknown
Buttons (6)
Type Name Multiplier
button Left Paddle -
button Right Paddle -
button Button 3 -
button Button 4 -
button Button 5 -
button Button 6 -
Sliders (4)
Type Name Multiplier Tolerance
slider Wheel axis 1.0 0.0 absolute
slider Combined pedals 1.0 0.0 absolute
slider Accelerator 1.0 0.0 absolute
slider Brake 1.0 0.0 absolute
Quoted from Site of "Various self-made".
import net.java.games.input.*;
import org.gamecontrolplus.*;
import org.gamecontrolplus.gui.*;
ControlIO control;
ControlDevice device;
ControlSlider[] sliders = new ControlSlider[4];
ControlButton[] button =new ControlButton[6];
This requires changing the number of arrays depending on the device used.
control = ControlIO.getInstance(this);
device = control.getDevice("Logicool WingMan Formula Force GP USB");//Change depending on the equipment used.
sliders[0] = device.getSlider(0);
Now you can declare. Since I created an array called "sliders []" earlier, I assigned it to it. If there are multiple buttons, change the number.
sliders[0].getValue()
The value from the slider can now be easily retrieved.
button[0] = device.getButton(0);
button[0].plug(this, "func1", ControlIO.ON_PRESS);//Processing when the button is pressed
button[0].plug(this, "func2", ControlIO.ON_RELEASE);//Processing when the button is released
The button was set like this. Each function name can be set and executed when an event occurs. The function is declared as follows.
void func1(){
//The process you want to execute
}
void func2(){
//The process you want to execute
}
It can be easily executed by combining the above keywords.
The value output from the controller was a positive to negative value, so it was necessary to adjust the value. In that case, it is convenient to use the "map" function. When converting x from the range of a → b to the range of c → d
float x = map(x,a,b,c,d);
It's easy to use like this.
This makes it very easy to use the game controller. Processing can be easily connected to Arduino via serial communication, so I thought that the things I could do would expand.
Recommended Posts