Passing array to Python Script
-
- Active Member
- Posts: 36
- Joined: Sat May 31, 2014 6:39 am
Passing array to Python Script
I am reading a bunch of ADCs using the XMOS Startkit, and printing the values in realtime to the console window using xScope. I need to access the ADC data from Blender, a digital modeling program. Blender allows the use of Python programs to move/ control models in response to inputs. What is a good way to pass the values I see in the Composer console window to the Python program (which is running in Blender)?
-
- XCore Expert
- Posts: 754
- Joined: Thu Dec 10, 2009 6:56 pm
Did you try the xScope socket interface?
-
- Active Member
- Posts: 36
- Joined: Sat May 31, 2014 6:39 am
I haven't heard anything about that. Is there a tutorial somewhere I can look at? I couldn't find anything about sockets in the xScope Support section.Bianco wrote:Did you try the xScope socket interface?
-
- XCore Expert
- Posts: 754
- Joined: Thu Dec 10, 2009 6:56 pm
I don't know about the xtimecomposer studio but on the command line you can try something like this:
xrun --xscope --xscope-realtime --xscope-port ip:port myapp.xe
I believe xscope implements a client TCP socket, so you will need to implement a server socket at the python side.
I haven't tried this yet.
xrun --xscope --xscope-realtime --xscope-port ip:port myapp.xe
I believe xscope implements a client TCP socket, so you will need to implement a server socket at the python side.
I haven't tried this yet.
-
- Active Member
- Posts: 36
- Joined: Sat May 31, 2014 6:39 am
Thank you for the information about the command line! I learn C as I need to, so I'm currently unfamiliar with socket implementation. I looked up a few examples and it looks pretty easy, so I'm going to ask some people about the specifics.Bianco wrote:I don't know about the xtimecomposer studio but on the command line you can try something like this:
xrun --xscope --xscope-realtime --xscope-port ip:port myapp.xe
I believe xscope implements a client TCP socket, so you will need to implement a server socket at the python side.
I haven't tried this yet.
-
- Active Member
- Posts: 36
- Joined: Sat May 31, 2014 6:39 am
Is there any kind of documentation on the xscope socket interface? I cannot seem to find it anywhere. Do you know of any examples or code snippets that I could use and adapt?
-
- XCore Legend
- Posts: 1274
- Joined: Thu Dec 10, 2009 10:20 pm
There is a Xscope socket host support library on github/xcore that makes it simpler to implement.
Not sure about any documentation
BTW there is a couple of apps that use the IP socket host in the StartKit examples
regards
Al
Not sure about any documentation
BTW there is a couple of apps that use the IP socket host in the StartKit examples
regards
Al