Shop OBEX P1 Docs P2 Docs Learn Events
Simple " IF " is not working — Parallax Forums

Simple " IF " is not working

TCTC Posts: 1,019
edited 2014-05-03 12:04 in Propeller 1
Hello all

I can not figure out why this " IF '' statement is not working. I think it should, but I could be wrong.

   upper_value := 50

   repeat PWM_counter from 0 to 100

        if upper_value => PWM_counter AND upper_value <> 0
          outa[upper_output] := 1

        else
          outa[upper_output] := 0 


It does not matter what I put in " upper_value" (values I tried 0, 30, 20, 40, 50, 100), the upper_output does not go high.

My thinking is;

PWM_counter = 0
upper_value = 25

then using the " IF " statement I have should come up " TRUE " since upper_value is greater than PWM_counter. And since it is " TRUE " the upper_output should be high.

Where am I going wrong? And what is going with this IF statement? Because I don't understand it.

Thanks
TC

Comments

  • TCTC Posts: 1,019
    edited 2014-05-03 12:04
    Sorry, but never mind. Once I clicked post, I seen my problem.
Sign In or Register to comment.