Shop OBEX P1 Docs P2 Docs Learn Events
USB Servo Controller conected to PC — Parallax Forums

USB Servo Controller conected to PC

Rob311Rob311 Posts: 83
edited 2009-06-07 23:26 in Robotics
This has to have come up before, but i cant find it.

I'm trying to connect my USB PSC to my pc and control it from VB or even Hyperterminal, but I can't figure out the code. How do I translate:
ch=0
ra=7
pw=1250
"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR
to a hyptertermial output? I've been able to use the !SCVER? and get a response, so I know its not a com issue.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-06-07 19:37
    Each of the items separated by commas produce a single byte. ch is a byte. ra is a byte. pw.LOWBYTE is the low order 8 bits of the 16 bit value pw. pw.HIGHBYTE is the high order 8 bits of the 16 bit value pw. You also need the carriage return character at the end (CR).

    If you're typing them by hand using Hyperterminal, you can often use the control key to get small values. Control-@ is a zero byte. Control-A is a one byte, etc.
  • Rob311Rob311 Posts: 83
    edited 2009-06-07 21:42
    I cant find any information in my hyperterminal help files about byte size... could you show me the string that you would type to have it move?
  • FranklinFranklin Posts: 4,747
    edited 2009-06-07 23:26
    Here is an ascii table www.asciitable.com/ Hyperterminal, although free is not a good terminal program for sending non text codes. I like a program called realterm.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.