Shop OBEX P1 Docs P2 Docs Learn Events
Pin assignment question - coupling one port to another — Parallax Forums

Pin assignment question - coupling one port to another

Don MDon M Posts: 1,653
edited 2011-07-17 22:32 in Propeller 1
What is the proper syntax to assign (couple) one port (pin) to another?

Is it outa[16] := outa[23] ?

I can't get it to work.

Thanks.

Comments

  • JonnyMacJonnyMac Posts: 9,208
    edited 2011-07-17 21:27
    If P23 is an input you'll want to use
    outa[16] := ina[23]
    

    You need to make sure P16 is in output mode, too.
  • Don MDon M Posts: 1,653
    edited 2011-07-17 21:31
    Thanks Jon
  • Mike GreenMike Green Posts: 23,101
    edited 2011-07-17 22:32
    Note that this doesn't really "couple" one pin to another. It just copies the current state of P23 to P16. You have to repeat this statement often enough to keep the setting of P23 up to date. How often is enough depends on how quickly the signal on P23 can change and how close you want to keep the state of one pin to another.
Sign In or Register to comment.