🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Driving Force GT C# Programming

Started by
2 comments, last by jun8 4 years, 5 months ago

Hi,

I am trying to program my Driving Force GT Controller using Logitech SDK. In SDK documents, i met a problem in obtaining data from controller, for examples, trying to obtain the speed from the pedal of controller and the related documents are limited.
Does anyone has experience in doing the same thing or any extra documents that could be helped in solving this issue?
Much appreciated.

Thanks!

Advertisement

What is the link to the SDK docs?

I don't know how you are doing this with C#, are you using the SDK, a third party Lib or DLLImport because I could give an answer for using the device via HID input as I believe the pedal is just handled as axis but don't know if this answer is in your desired environment; you provided a little too view information for that

Hi,

Appreciate your reply.

The link of SDK is from here https://www.logitechg.com/en-my/partnerdeveloperlab/sdk-resource-list/steering-wheel-sdk.html

In the SDK File, there has document regarding the programming section but is too little information and there is a sample program in C++ with the tile “SteeringWheelSDKDemo” in sample folder. I follow what exactly from there but since it is in C++, so there might have some different.

My code is as below:

class Program

{

static void Main(string[] args)

{

Logi b = new Logi();

b.Start();

b.Update();

b.Stop();

}

}

public class Logi

{

public void Start()

{

LogitechGSDK.LogiSteeringInitialize(false);

}

public void Update()

{

if (LogitechGSDK.LogiUpdate() && LogitechGSDK.LogiIsConnected(0))

{

if ((LogitechGSDK.LogiIsManufacturerConnected(0, LogitechGSDK.LOGI_MANUFACTURER_LOGITECH)) && (LogitechGSDK.LogiIsModelConnected(0, LogitechGSDK.LOGI_MODEL_DRIVING_FORCE_GT)))

{

if (LogitechGSDK.LogiIsPlaying(0, LogitechGSDK.LOGI_FORCE_SPRING))

{

LogitechGSDK.LogiStopSpringForce(0);

Console.WriteLine("No connected");

}

else

{

// LogitechGSDK.LogiPlaySpringForce(0, 50, 50, 50);

//LogitechGSDK.LogiPlayBumpyRoadEffect(0, 100);

//LogitechGSDK.LogiStopBumpyRoadEffect(0);

for (int i = 0; i <= 10; i++)

{

//var Data = new LogitechGSDK.LogiControllerPropertiesData();

// LogitechGSDK.LogiGetCurrentControllerProperties(0, ref Data);

// var output = LogitechGSDK.LogiGetStateCSharp(0);

var dIJOYSTATE2ENGINES = LogitechGSDK.LogiGetStateCSharp(0);

// if (Data.combinePedals)

//{

Console.WriteLine(dIJOYSTATE2ENGINES.lARx);

Console.WriteLine(dIJOYSTATE2ENGINES.lARy);

Console.WriteLine(dIJOYSTATE2ENGINES.lARz);

Console.WriteLine(dIJOYSTATE2ENGINES.lAX);

Console.WriteLine(dIJOYSTATE2ENGINES.lAY);

Console.WriteLine(dIJOYSTATE2ENGINES.lAZ);

Console.WriteLine(dIJOYSTATE2ENGINES.lFRx);

Console.WriteLine(dIJOYSTATE2ENGINES.lFRy);

Console.WriteLine(dIJOYSTATE2ENGINES.lFRz);

Console.WriteLine(dIJOYSTATE2ENGINES.lFX);

Console.WriteLine(dIJOYSTATE2ENGINES.lFY);

Console.WriteLine(dIJOYSTATE2ENGINES.lFZ);

Console.WriteLine(dIJOYSTATE2ENGINES.lRx);

Console.WriteLine(dIJOYSTATE2ENGINES.lRy);

Console.WriteLine(dIJOYSTATE2ENGINES.lRz);

Console.WriteLine(dIJOYSTATE2ENGINES.lVRx);

Console.WriteLine(dIJOYSTATE2ENGINES.lVRy);

Console.WriteLine(dIJOYSTATE2ENGINES.lVRz);

Console.WriteLine(dIJOYSTATE2ENGINES.lVX);

Console.WriteLine(dIJOYSTATE2ENGINES.lVY);

Console.WriteLine(dIJOYSTATE2ENGINES.lVZ);

Console.WriteLine(dIJOYSTATE2ENGINES.lX);

Console.WriteLine(dIJOYSTATE2ENGINES.lY);

Console.WriteLine(dIJOYSTATE2ENGINES.lZ);

if (LogitechGSDK.LogiButtonTriggered(0, 01))

{

Console.WriteLine("Yes");

}

Console.ReadLine();

}

Console.WriteLine("connevted");

Console.ReadLine();

}

}

}

}

public void Stop()

{

LogitechGSDK.LogiSteeringShutdown();

}

}

I tried a lot of time but dont know where the problem is. Really need some help.

Thank you!

This topic is closed to new replies.

Advertisement