Shop OBEX P1 Docs P2 Docs Learn Events
Data converions? — Parallax Forums

Data converions?

edmondfoxedmondfox Posts: 15
edited 2005-10-22 21:34 in BASIC Stamp
I have written a windows interface to send data to the stamp over the serial port, however I can only get the data to be sent as an array of characters, not integers like the stamp expects. Do you have any ideas what I can do on the stamp side to take this data and convert it to the proper form so that stamp can use it to run the motors?

Comments

  • NewzedNewzed Posts: 2,503
    edited 2005-10-22 15:52
    Can you give me an example of the array the Stamp is receiving?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-22 16:02
    There is a VB program attached to the product page of the RS-232 DCE AppMod that shows how the Stamp can be setup to receive bytes, words, or even strings.· The Stamp just needs to know what's coming so it can get ready.

    http://www.parallax.com/detail.asp?product_id=29120

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • edmondfoxedmondfox Posts: 15
    edited 2005-10-22 21:11
    In the windows program I am sending data to control a stepper motor as an array of characters. An example of what would be sent is "+" then "100" then a space, then "+" then "100" then a space, then "1"(ie. +100 +100 1 but sent in sections as I specified). I decided to send them seperately because I thought it would make it easier. However I would like the stamp to interpret the 100 as the number 100, not as a characters. Will storing them into the onchip memory allow this conversion?

    Post Edited (edmondfox) : 10/22/2005 9:19:22 PM GMT
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-22 21:34
    This article explains everything you need to know -- though you'll have to adapt the techniques for your specific application.

    http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv89.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.