Shop OBEX P1 Docs P2 Docs Learn Events
Input from a computer — Parallax Forums

Input from a computer

edited 2008-07-01 21:18 in General Discussion
I am trying to drive two motors using the SX controller, and a computer will be sending simple commands (move forward, turn left, stop). The best way to do this of which I can think is to have the computer set and clear two pins on the SX. Eventually I'd like continuous control for both motors, but I could probably hack that together on the computer side if needed.

How have people done this in the past? I'm trying to think of ways using the phone jack (EDIT: Or the computer's sound card) and similar on the professional development board.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--
Christopher Agocs
Georgia Institute of Technology

Post Edited (Christopher Agocs) : 7/1/2008 8:56:48 PM GMT

Comments

  • VelocitVelocit Posts: 119
    edited 2008-07-01 20:55
    You could use a MAX232 line driver on the SX side of things and take serial inputs from your computer. This method would only require one I/O pin. Since you only need to control a few commands, you would only need to send one byte per command: i.e. $00 = forward, $01 = reverse, etc.. The computer interface could be as something as simple as HyperTerminal or something as complicated as a custom VB program.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Paul
  • ZootZoot Posts: 2,227
    edited 2008-07-01 21:07
    You can also construct a simple level shifter with parts you may have on hand. See attached. Also see better shchematic and some sample code in Nuts/Volts 143: www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol8/col/nv143.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
    879 x 499 - 66K
  • edited 2008-07-01 21:18
    I suppose I was just being lazy by refusing to consider RS-232. Thank you for the .pdf, Zoot.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --
    Christopher Agocs
    Georgia Institute of Technology
Sign In or Register to comment.