Shop OBEX P1 Docs P2 Docs Learn Events
What is wrong — Parallax Forums

What is wrong

GdSisGdSis Posts: 12
edited 2006-12-30 15:12 in Propeller 1
Hello,

Can someone please tell me what I'm doing wrong·here?
Does ctrx·requires a pin assignment in order to work? Manual says not.
·
PUB start | tmp1  
     ctrb := %0_00100_000_00000000_000000_000_000000
     frqb := 128    'about 1/2 seg
 
     'then
 
     tmp1 := phsb          
     if (tmp1 and $8000_0000)      
        '1 do something if phsb msb is set
     else
        '2 do something if phsb msb is not set



It always·executes 1 cry.gif

TIA

Comments

  • Remy BlankRemy Blank Posts: 42
    edited 2006-12-30 14:54
    The 'and' operator is a boolean operator. You probably want to replace it with '&', which is the bitwise and operator.

    -- Remy
  • GdSisGdSis Posts: 12
    edited 2006-12-30 15:12
    Well, what a newbie error (I'm just starting with this jewel of chip).

    Thanks Remy, problem solved tongue.gif

    GdS
    Remy Blank said...
    The 'and' operator is a boolean operator. You probably want to replace it with '&', which is the bitwise and operator.

    -- Remy
Sign In or Register to comment.