Special Function Variables question.

@lowa

New Member
Is it possible to retreeve the output pins status and store it into a variable by peeking the Special Function Variables area on a 20M?

also is it there an easy way to swap bit 0 with bit 7, bit 1 with bit 6, bit 2 with bit 5, and bit 3 with b4 on the 20M.

Thanks for your replies!
 

hippy

Ex-Staff (retired)
READOUTPUTS is the command you want to determine what is currently being output.

To swap bits on a 20M, as there's no REV operator, the best way to reverse bits is to use b1 as a temporary variable ...

b0 = %11001010
bit8 = bit7
bit9 = bit6
bit10 = bit5
bit11 = bit4
bit12 = bit3
bit13 = bit2
bit14 = bit1
bit15 = bit0
b0 = b1

b0 will then hold %01010011

That can be modified to move various bits and not swap others.
 
Last edited:

@lowa

New Member
hi Beaniebot
Basic manual 2 page 151 is the READOUTPUTS command that works with the A,M,X and X1 serie but not with the X2.
let b0 = outpins is giving a syntax error in the programming editor in X2 mode so my question is what is the X2 equivalent for readoutputs and what is the right syntax.
thanks
 

Technical

Technical Support
Staff member
let b0 = outpins?

where ? is the port in question e.g for portB

let b0 = outpinsB
 
Top