Shop OBEX P1 Docs P2 Docs Learn Events
Syntax questions — Parallax Forums

Syntax questions

Let's Go!Let's Go! Posts: 124
edited 2009-12-06 17:51 in BASIC Stamp
hello,

1.· when one goes to help, searches "case", the help section notates it with a # sign preceeding it. But when you examine the qtis boe bot example of code, the # sign does not appear. can someone explain the meaning of the # sign if it is not being used in code.

2.· also, the typical code i learned for moving a servo is as follows:

pulsout 13, 750
pause 20

BUT, the qtis boe bot example of code again simply gives the following:

case %1101
pulsout 13, 750

and it neglects the 20 ms pause. albeit, this code is for a constant rotating servo if that makes a difference.

any constructive comments will be appreciated

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The smarter I get, the more I understand I don't know!

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2009-12-06 16:50
    There are two versions of CASE - the one with # is for the selection of processor type within a program meant to be used with several Stamp types. Have a look at the Parallax programming template which shows the use of #CASE to adjust serial parameters based on which processor chip is detected.

    The plain CASE statement is also described in the Help file of the IDE. Look under "Select Case".

    The repetition rate is somewhat flexible and depends on the particular servo used. If there is lots of programming between refreshes , a specific PAUSE may not be required.

    The continuous rotation servo may, indeed, be less sensitive to pulse repetition rate.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Let's Go!Let's Go! Posts: 124
    edited 2009-12-06 17:51
    thanks tom, once again. you saved my life.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The smarter I get, the more I understand I don't know!
Sign In or Register to comment.