Shop OBEX P1 Docs P2 Docs Learn Events
IF ELSEIF Question — Parallax Forums

IF ELSEIF Question

Silver242Silver242 Posts: 12
edited 2009-07-22 19:23 in Propeller 1
Hi,

· I have the PE Kit , and·i have a question about··chapter 7 in the first program· (TestRcDecay) i want to turn led on when for example the time = 215
i used this way·

con

·Red· = 215


pub

·if· Red = time
··· !outa[noparse][[/noparse]4]

but it·didnt work.·please help .

Comments

  • Nick MuellerNick Mueller Posts: 815
    edited 2009-07-22 18:28
    The operator to test for equality is "=="

    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • Silver242Silver242 Posts: 12
    edited 2009-07-22 18:44
    I changed the equality to == , but it didnt work
  • TimmooreTimmoore Posts: 1,031
    edited 2009-07-22 18:58
    have you got a dira := 1 to set the pin to be an output?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-22 19:04
    That should be "dira[noparse][[/noparse] 4 ] := 1" before the if statement
  • Silver242Silver242 Posts: 12
    edited 2009-07-22 19:23
    Thanks everyone it works.
Sign In or Register to comment.