Anyone interested in Python-Prop communication libraries?
John Board
Posts: 371
G'day everyone,
I have been pondering the idea of developing a Python-Prop (visa versa) library. Would anyone be interested in such thing? It would kinda be like the FullDuplexSerial - except slightly easier to use, here are a few code examples:
Python:
Prop:
I know that these code examples are pretty bad, but you get the picture. Although that might seem simplistic, I am thinking of adding in quite a few neat features, such as a running average, storage of history, etc. I just had another thought as well, possibly being able to give the prop commands, such as "STORE RAM $00 "Cat"". Which would store the string "Cat" at the ram address of $00 for example. You get the picture.
So all in all, what does everyone think? If nobody is interested, it might not be worth my while, if there is enough interest, I will probably dev it.
-John
I have been pondering the idea of developing a Python-Prop (visa versa) library. Would anyone be interested in such thing? It would kinda be like the FullDuplexSerial - except slightly easier to use, here are a few code examples:
Python:
import propcomms propcomms.start(0) 'Starts comms on the computer port 0 while 1: print propcomms.getDec() 'Propcomms waits for the prop to send a string, optional "no-wait" might be included
Prop:
OBJ cc: "ComputerComms" Ping: "Ping" PUB Main cc.start(31,30) '31 being the RX pin and 30 being the TX pin repeat cc.sendDec(Ping.Centimeters(0)) 'Assuming that a Ping((( is connected to P0 waitcnt(clkfreq/10+cnt)
I know that these code examples are pretty bad, but you get the picture. Although that might seem simplistic, I am thinking of adding in quite a few neat features, such as a running average, storage of history, etc. I just had another thought as well, possibly being able to give the prop commands, such as "STORE RAM $00 "Cat"". Which would store the string "Cat" at the ram address of $00 for example. You get the picture.
So all in all, what does everyone think? If nobody is interested, it might not be worth my while, if there is enough interest, I will probably dev it.
-John
Comments
Paul
I am working on a MAC with BST and it would be great to be able to have a python program to talk to a spin program that i could port between os. One of the big advantages of python.
rich
If I get around to it, I might even consider doing the same thing with Java as well.
Just had another thought. Including a way to compile and download code to the prop, using Propellant, like this:
If that didn't make sense, you'll see when the python library comes out what I mean.
If we get CSP channels working, I would like to inquire about Python-Prop with CSP channels. This should be the same as the regular serial interface, with a "slight" modification to include the CSP interface. Then it should talk to any prop implementation that uses CSP.
CSP for Python, anybody???
http://code.google.com/p/python-csp/wiki/Tutorial
Drat! Need to fork myself for another project!
-John
I cannot find the original thread, but I probably have somewhere the python examples. In case I'll post them.
Massimo