Shop OBEX P1 Docs P2 Docs Learn Events
Question about Propeller Manual — Parallax Forums

Question about Propeller Manual

mynet43mynet43 Posts: 644
edited 2010-07-01 22:54 in Propeller 1
I'm using the waitpeq and waitpne commands.

On page 327 of my old manual it gives examples that don't look right:

waitpeq(%100000, 5, 0) ' Wait for Pin 5 to go high
waitpeq(%000000, 5, 0) ' Wait for Pin 5 to go low

These don't look right.

Shouldn't they be:

waitpeq(%100000, %100000, 0) ' Wait for Pin 5 to go high
waitpeq(%000000, %100000, 0) ' Wait for Pin 5 to go low

Are these typos, or am I missing something?

Thank you for the help.

Jim

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-07-01 22:13
    You're correct.

    Usually I do:

    waitpne( 0, |<5, 0) ' Wait for pin 5 to go high
    waitpeq( 0, |<5, 0) ' Wait for pin 5 to go low

    That way I have less risk in getting the position of the bit wrong somewhere.
  • mynet43mynet43 Posts: 644
    edited 2010-07-01 22:54
    Thanks Mike,

    I thought that was right, but I've been wrong before.

    I like the |<5 too, I was just trying to make it look like the other examples.

    Thanks again,

    Jim
Sign In or Register to comment.