John Board
03-28-2012, 10:31 AM
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:
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
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