ARDUINO CODE X-SIM CONVERTER

Running simulator build projects.
Please use the image gallery for your pictures, a short tutorial can be found here.
The first image in the first post will be shown in the project gallery.

ARDUINO CODE X-SIM CONVERTER

Postby gas2018 » Thu 28. Feb 2019, 13:36

Hello Community, after a lot of reasearch in the internet and many hours struggeling with the x-sim software i fainally got an Arduino code which is suitable for getting out many racegame values. I am now able to get out all the data which i need and be able to send these to my Arduino.

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;
}
}
}
Attachments
gas2018
 
Posts: 1
Joined: Thu 28. Feb 2019, 12:49
Has thanked: 0 time
Been thanked: 3 times

Re: ARDUINO CODE X-SIM CONVERTER

Postby sbdtoni@hotmail.com » Thu 1. Aug 2019, 08:42

hola Gas, me pongo en contacto contigo para ver si me puedes ayudar, estoy intentando hacer funcionar dos motorcillos servo para hacer una maqueta RC de un 2dof y no encunetro el schetch de arduino y no se como hacerlo funcionar, mira si me puedes echar una mano.
mi correo es sbdtoni@gmail.com
muchas gracias.
un saludo
sbdtoni@hotmail.com
 
Posts: 5
Joined: Sun 28. Jul 2019, 09:00
Has thanked: 0 time
Been thanked: 1 time

Re: ARDUINO CODE X-SIM CONVERTER

Postby Eliton » Thu 27. May 2021, 00:41

Hello GAS could send me the configuration of x-sim eliton.lamim@gmail.com... agradeço
Eliton
 
Posts: 4
Joined: Sun 1. Apr 2012, 05:07
Has thanked: 1 time
Been thanked: 0 time

Re: ARDUINO CODE X-SIM CONVERTER

Postby andreschaos » Fri 15. Apr 2022, 14:15

Hi Gas! Can you send me the X-Sim configuration please? My e-mail is andresogutierrez@hotmail.com

Thankssss!!!
andreschaos
 
Posts: 5
Joined: Fri 8. Apr 2022, 04:55
Has thanked: 0 time
Been thanked: 0 time

Re: ARDUINO CODE X-SIM CONVERTER

Postby kanz » Mon 2. Sep 2024, 01:44

Hello Gas, I am Korean. I'm making a 2dof simulator. Please send your x-sim configuration to kanz1@naver.com. Thank you very much.
kanz
 
Posts: 2
Joined: Tue 27. Aug 2024, 06:33
Has thanked: 0 time
Been thanked: 0 time


Return to Motion simulator Projects in progress

Who is online

Users browsing this forum: No registered users and 1 guest