Shop OBEX P1 Docs P2 Docs Learn Events
PSC get position command — Parallax Forums

PSC get position command

Peter VerkaikPeter Verkaik Posts: 3,956
edited 2006-04-30 11:52 in BASIC Stamp
The psc manual states
Syntax: “!SCRSP” x $0D
Reply: x y z(where x is the channel number, and z:y is the value reported)
The basic stamp example in the manual says
SEROUT Sdat, Baud+$8000, [noparse][[/noparse]"!SCRSP", ch, CR]
SERIN Sdat, Baud, 1000, Init,[noparse][[/noparse]STR Buff\3]
DEBUG "Servo ", DEC buff(0), " ", HEX2 buff(1), " :", HEX2 buff(2), CR

which would indicate the position is y:z (and not z:y)

Can anyone tell what the correct byte order of the position value is?

regards peter

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-04-30 11:52
    I found a bs1 program that confirms
    the get position command returns the position
    highbyte before the lowbyte, which is the reverse
    order as stated in the manual. The example
    in the manual is therefore correct.

    regards peter
Sign In or Register to comment.