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!