How to Read input from txt file...for external control,

Hi! All…

We have an external joystick controller used on a real life Crane setup, and have a driver who writes the output from the joystick to a txt file. Can Unity read this txt file every frame so we can drive our crane?

How do I sqript this?

The file only holds input data :
1
1
1
0
1
1
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
0
1
0
0
1

Any Idea?

237109–8484–$mdh_338.txt (81 Bytes)

Btw here is the controller

why not use serialPort?

The controller is connected to the computer by USB or ethernet, we have a
“labjack” input device for the signal input, and that driver is set up to write that txt file,
the different zeroes and one’ s you see is digital input, the higher number is the analog input!
My problem is how do I read this into unity, instead of the Windows standard directx input?

You can use whichever of the XXXReader classes from System.IO is most suitable, or you can use the WWW class with a file:// URL.

we are doing something similar and have been very successful with udp communication that allows to communicate with both stand alone and browser embedded binaries with a very good latency.