Shop OBEX P1 Docs P2 Docs Learn Events
Motor Mount and Wheel Kit w/ Position Controller code question — Parallax Forums

Motor Mount and Wheel Kit w/ Position Controller code question

Joe FishbackJoe Fishback Posts: 99
edited 2009-04-09 01:26 in Robotics
I have two questions about the code syntax in the Parallax documention of the "Position Controller" . Under the "Commman Set Details" for the
Command #4 TRVL it is written

Transmit Data Format
[noparse][[/noparse]·Command:Address] , [noparse][[/noparse]NumberH] , [noparse][[/noparse]NumberL]

In the code that command is written as follows-

GoDistance:
· SEROUT CommPin, BaudValve, [noparse][[/noparse]TRVL + Wheel]
· SEROUT CommPin, BaudValve, [noparse][[/noparse]Distance.HIGHBYTE, Distance.LOWBYTE]

Does Command:Address mean you add the Command and Address?

Why is the SEROUT command put on two lines and not one line as it is in the documention? What is the rule for putting a SEROUT command on·two lines ?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
······ Joe Fishback

-Robots are my friends-

Comments

  • Tom CTom C Posts: 461
    edited 2009-04-09 01:26
    Hi Joe,

    The demo code is written as you have written it in GoDistance.

    I have tried the demo code with the Position Controller and it works. Therefore the GoDistance code syntax is correct as written.

    Regards,

    TCIII

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
Sign In or Register to comment.