Reading an output state on a BS2
jeff2.0
Posts: 24
I am trying to read the value of an output on a BS2.
Reading an input is easy. Here is an example.
IF IN0 = 1 THEN (something)
......but how can I read the value of an output? Can I do it with an IF/THEN statement?
Reading an input is easy. Here is an example.
IF IN0 = 1 THEN (something)
......but how can I read the value of an output? Can I do it with an IF/THEN statement?
Comments
You can also refer to OUTn to see what the I/O pin is supposed to be (if it's indeed an output).
All of the I/O registers (INS / OUTS / DIRS) and their individual pieces are considered to be variables so you can set and test their values like any other variable. In the case of INS, you can't actually set its value since it's set from the state of the I/O pins.
Thanks Mike.
j
You ASK an input what it is. It can change at any time.
You TELL an output what it is. It stays that way until your program changes it.