28X1 readouputs b0 vs let b0 = outpins

BCJKiwi

Senior Member
28X1 readoutputs b0 vs let b0 = outpins

These two alternate forms of code for testing the outputs should be the same.

However, in the simulator, the first does not change b0 in the display nor does the If test respond.

Code:
#picaxe 28x1
main:
high 2
let b0 = outpins
If bit2 = 1 then
 sertxd("output 2 On",cr,lf)
EndIf
goto main
Code:
#picaxe 28x1
main:
high 2
readoutputs b0
If bit2 = 1 then
 sertxd("output 2 On",cr,lf)
EndIf
goto main
Is this just a simulator issue or does the let b0 = outpins command not function at all?
Assuming it does work, what is the advantage of using this form of command over readoutputs?
 
Last edited:

Technical

Technical Support
Staff member
Looks like a simulator issue we will look into, real chip will be fine.

The advantage of the 28X1 format is that outpins can be used in any formula like any normal variable e.g.
let b1 = outpins & 128

In your simple example there is not much advantage either way.
 
Top