
So far I'm pretty happy with my progress of a self made dash (maybe get to a full motion rig one day). I have X-Sim running with rFactor2 (pCars has no API yet) and I'm receiving data, which took a while, but I got there. I also have an Arduino that's now receiving the data and I can get Revs, Speed, Gear and I can drop that onto a 4-digit 7-segment display. I only have 1 at present, so with a quick code change I can get it displaying all info from x-sim.
What I want the dash to do tho is to send info back from the Arduino to the game, this is for switches, etc. So without x-sim in the equation I can send data from the Arduino to a C# app and although I've not done it yet I think it's fairly easy to then send keystrokes to rFactor2. But if I put x-sim back in the loop there doesn't appear to be a way I can extract data from the Arduino, it's a 1-way street if I understand it correctly.
This is where I'm a little stuck. I can think of two ways around this so far, but neither is particularly great:
- Get another Arduino connected via USB to run the switches and output from this Arduino to a C# app
- Create a virtual serial device in the PC and get x-sim to send data to that. I'll create a C# app to then attach to the Arduino, which will grab data from the x-sim feed and just offload it to the Arduino unchanged. But as the serial port to the Arduino is connected to the C# app I can also read from it and then pass that to rFactor as keypresses, etc.
The latter approach is double handling the data, which is never good and the first requires additional hardware and USB connectivity + more to go wrong. So I'm hoping that there is some obvious route, existing library, plugin or something I'm missing that will set me right.
Mike...
** I posted this on another forum as well in the hope to get the widest coverage of ideas [Doesn't appear I can name it as I get a * instead of the name] **