Below I send some screenshots of my X-Sim converter setup.
Unfortunately i am not able to upload here my X-Sim Profile-Setup but if anybody want it, do not hesitate to ask and i will send you it via email.
I hope i could help you with this post and wish you a nice and succsessful day.
My full USO parser command is :
S~a01~R~a02~Y~a03~V~a04~O~a05~L~a06~P~a07~A~a08~~13~
- Code: Select all
int Speed=0;
int Drehzahl=0;
int Yaw=0;
int Verticalforce=0;
int Roll=0;
int Lateralforce=0;
int Pitch=0;
int Acceleration=0;
bool number;
int i;
char kind_of_data;
char kind_of_dataR;
bool M;
void setup() {
// put your setup code here, to run once:
Serial.begin(38400);
}
void loop() {
if(Serial.available() >0)
{
////////////////////////////////////////////////////////////////////////
kind_of_data = Serial.read();
delay(1);
M =false;
}
while(Serial.available() >0)
{
delay(1);
if (M==true)
{
kind_of_data =kind_of_dataR;
}
int Data100 = -1;
int Data10 = -1;
int Data1 = -1;
number=true;
i=0;
while(number== true)
{
char a = Serial.read();
int c = (int)a;
if(c<60&&c>0)
{
if(i==0)
{
Data100 = c-48;
}
if(i==1)
{
Data10 = c-48;
}
if(i==2)
{
Data1 = c-48;
}
i++;
}
else if(c>60)
{
number=false;
i=0;
kind_of_dataR = a;
M=true;
}
else if(c<0)
{
M=false;
}
}
//Daten anpassen: aus 1 wird 001, aus 10 wird 010 etc.
while (Data1 < 0) {
Data1 = Data10;
Data10 = Data100;
Data100 = 0;
}
int Data = 100*Data100 + 10*Data10 + Data1;
//////////////////////////////////////////////////////////////////////
if (kind_of_data == 'S') {
Speed = Data;
}
else if (kind_of_data == 'R') {
Drehzahl = Data;
}
else if (kind_of_data == 'Y') {
Yaw = Data;
}
else if (kind_of_data == 'V') {
Verticalforce = Data;
}
else if (kind_of_data == 'O') {
Roll = Data;
}
else if (kind_of_data == 'L') {
Lateralforce = Data;
}
else if (kind_of_data == 'P') {
Pitch = Data;
}
else if (kind_of_data == 'A') {
Acceleration = Data;
}
}
}