Shop OBEX P1 Docs P2 Docs Learn Events
sending data from propeller to PC — Parallax Forums

sending data from propeller to PC

accmeintaccmeint Posts: 6
edited 2010-01-09 22:16 in Propeller 1
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

Comments

  • LeonLeon Posts: 7,620
    edited 2010-01-09 17:08
    Have a look at float_demo.spin.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM

    Post Edited (Leon) : 1/9/2010 5:43:42 PM GMT
  • StefanL38StefanL38 Posts: 2,292
    edited 2010-01-09 17:32
    You need a RS232 to USB-adapter to do this.
    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
  • accmeintaccmeint Posts: 6
    edited 2010-01-09 21:50
    Hello and thank you for your responses...

    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.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-09 22:06
    Something like this: www.parallax.com/StoreSearchResults/tabid/768/List/0/SortField/4/ProductID/378/Default.aspx?txtSearch=rs232+usb

    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
  • SamMishalSamMishal Posts: 468
    edited 2010-01-09 22:16
    Hi Accmeint,

    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
    ·
Sign In or Register to comment.