sending data from propeller to PC
accmeint
Posts: 6
Hello,
I am interested in sending data (floats if possible) from my propeller demo board to a data file residing on my laptop.· I've been looking into the "serial terminal" application but is it possible to set up another USB connection for the propeller to write data out to a file on the PC?
Thank you
I am interested in sending data (floats if possible) from my propeller demo board to a data file residing on my laptop.· I've been looking into the "serial terminal" application but is it possible to set up another USB connection for the propeller to write data out to a file on the PC?
Thank you
Comments
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Post Edited (Leon) : 1/9/2010 5:43:42 PM GMT
Then you can setup any other PIN for sending serial data by using one of the serial drivers from the obex or that come with the propeller-tool that provides a "str"-method.
Inside the float_demo.spin you replace the tv_terminal-object by the serial driver object. Therefor you have to do some minor adaptions to the code.
best regards
Stefan
By a "RS232 to USB-adapter" are you refering to something like the parallax memory stick data logger, (item number 27937)?
Thank you for your time.
Or this: www.parallax.com/StoreSearchResults/tabid/768/txtSearch/propclip/List/0/SortField/4/ProductID/398/Default.aspx
The first requires some interface components for most Propeller boards. The second can connect directly to the Propeller.
Post Edited (Mike Green) : 1/9/2010 10:11:09 PM GMT
Have a look at this posting on the Propeller forum where
PRECISELY what you want to do is being achieved.
http://forums.parallax.com/showthread.php?p=846138
I think this will help.
As far as floats are concerned.....a floating point number in the Propeller
is saved using a binary representation that fits in a 32 bit (LONG) number.
You can send floating point numbers just as if they were 32 bit integers
(ie 4 bytes).....but the best way to actually send these values is to
convert them to their TEXT format and send that through so that you can
read them on the other side.
In the OBEX (and actually·in·the Propeller Tool library) there are these objects
that will help you manipulate and use floating numbers
Float32.Spin, Float32A.Spin, Float32Full.Spin, FloatMath.Spin, FloatString.Spin.
You may really just want to use the Float32.Spin and FloatString.Spin. Where the
latter is the one that helps you convert the floating number to its string representation
so that you can send it over the Serial port to the PC and it can be saved in a TEXT
file that can be easily read.
I hope this helps.....if you tell me more what you want to do then perhaps I can
give you a more concrete example of how to do it.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Samuel
www.RobotBASIC.com
·