Shop OBEX P1 Docs P2 Docs Learn Events
How do I invert the logic in this statement? outa[x] := ina[y] — Parallax Forums

How do I invert the logic in this statement? outa[x] := ina[y]

Don MDon M Posts: 1,652
edited 2013-12-02 13:26 in Propeller 1
I have the statement outa[5] := ina[19] where I look at input 19 logic level and I pass that on to output 5.

So when input 19 is high then output 5 goes high. But what if I want when input 19 is low then output 5 goes high and when input 19 is high output 5 goes low.

How do I invert the logic in that statement?

It's part of a repeat loop where it's looked at all the time
repeat

  outa[5] := ina[19]

Comments

  • Don MDon M Posts: 1,652
    edited 2013-12-02 10:39
    Figured it out...
    repeat
    
      outa[5] := !ina[19]
    

    Thanks anyway if you were going to reply!
  • garyggaryg Posts: 420
    edited 2013-12-02 13:26
    Thanks Don M
    Bits of information like this are very valuable to me.
    I've placed a fair bit of time into understanding spin.
    Small items like this help alot.
Sign In or Register to comment.