Shop OBEX P1 Docs P2 Docs Learn Events
28023 Servo Controller — Parallax Forums

28023 Servo Controller

bdrew7bdrew7 Posts: 38
edited 2011-06-10 13:27 in Robotics
I am attempting to use a 28023 Parallax serial servo controller with a processor that uses the Microsoft .Net Micro Framework and C#. The processor has bi-directional serial ports. I understand the Basic Stamp use one bi-directional line and that the levels will need to be translated to and from ttl levels with positive logic.

My question is how to encode the instruction to the PSC. The basic stamp command is "!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR. Is the equivalent command one string such as "ISC,1,32,22,32" where ch = 1, ra = ew, lowbyte = 22 and highbyte = 32 for example?

For this demonstration, I simple need to move the motor back and forth a few times.

Thanks in advance for help.
bdrew7

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-06-10 13:10
    Not quite. You've got everything in quotes, so it's all a string. The numeric values are actually individual byte values. What you need is something like the following bytes: "!", "S", "C", 1, 32, 22, 32, CR. The CR is actually the byte value 13. I'm not familiar with .Net I/O calls, but there must be one that allows you to send a single byte by specifying the numeric value of the byte. That's what you need for everything after the "!SC". You could use the string transmit call for the "!SC" if you want.
  • bdrew7bdrew7 Posts: 38
    edited 2011-06-10 13:27
    Thanks for the prompt response! Will give it a try.

    bernard
Sign In or Register to comment.