Extended LPT pins direction
Sometimes it's not enough commands described in the
basic instructions. More advanced commands allow more flexible management of LPT outputs.
Syntax 1: Extended states
111000!!??xx [count]
- Use the symbol 1 to set HIGH output state (3 to 5 V).
- Use the symbol 0 to set LOW output state (0 V).
- Use the symbol ! to inverse current output state.
- Use the symbol ? to randomize current output state.
- Use the symbol x to stay untouched current output state.
- Use decimal from 2 to 100 as [count] argument to retry specified command for [count] times.
sleeps 500 ; Specify regular pause between steps (pause = 500 ms)
CYCLE: ; Define the Label named as "CYCLE"
000000000000 ; Reset all outputs to LOW state
111000!!??xx ; 1,2,3 to HIGH; 4,5,6 to LOW; 7,8 - invert; 9,10 - random; 11,12 - not touch
111111111111 ; Set all outputs to HIGH state
111000!!??xx ; 1,2,3 to HIGH; 4,5,6 to LOW; 7,8 - invert; 9,10 - random; 11,12 - not touch
111000!!??xx 8 ; Do this command for 8 times
goto CYCLE ; Goto the "CYCLE" Label (Infinite cycle)
Syntax 2: Extended commands
<+|-|~|&|?> 110011001100 [count]
- Use the symbol 1 to point bit (output).
- Use the symbol 0 to ignore bit (output).
- Use decimal from 2 to 100 as [count] argument to retry specified command for [count] times.
- Use <+, -, ~, &,?> for select operation over pointed outputs.
- '+' is logical OR, '&' - Logical AND, '~' - Inversion, '?' - Random.
+111100000000 ; Set pointed outs to HIGH state (rest outs stay untouched)
-111100000000 ; Set pointed outs to LOW state (rest outs stay untouched)
~111100000000 ; Invert state of pointed outs (rest outs stay untouched)
?111100000000 ; Set random state for pointed outs (rest outs stay untouched)
&111100000000 ; Stay untouched only outs pointed as 1 (rest outs reset to LOW),
; or "Reset all outs to LOW state except outs pointed as 1"
Syntax 3: Extended pointing
<+|-|~|&|?> (1,2,3,4,5,6) [count]
- Use brackets and commas to specify numbers of outputs that must be pointed.
- Use <+, -, ~, &, ?> for select operation over pointed outputs.
- Use decimal from 2 to 100 as [count] argument to retry specified command for [count] times.
+(1,4,7,10) ; Set pointed outs 1, 4, 7 and 10 to HIGH state,
; (rest outs stay untouched)
; it is equivalent to 1xx1xx1xx1xx
-(1,2,3) ; Set pointed outs 1, 2 and 3 to LOW state,
; (rest outs stay untouched)
; it is equivalent to 000xxxxxxxxx
~(6,7,8) ; Invert pointed outs 6, 7 and 8,
; (rest outs stay untouched)
; it is equivalent to xxxxx!!!xxxx
~(9,10) ; Set Random state for pointed outs 9 and 10
; it is equivalent to xxxxxxxx??xx
&(1,12) ; Reset all outputs to LOW state, except outs no. 1 and 12
; it is equivalent to x00000000000
Remarks
### Contraction ### Only in older versions
1010 [count]
- If you specify only part of output states, missing bits will be filled by last specified bit.
; Specified ; Assumed
1010 ; 101000000000
0101 ; 010111111111
1 ; 111111111111
0 ; 000000000000
1100x ; 1100xxxxxxxx
11110000! ; 11110000!!!!
#### Visibility ####
o.o.o.o.o.o. [count]
- You can use multiple sets of synonyms «1o», «0.», «xX*».
o.o.o.o.o.o. ; It is equivalent to 101010101010
oooo....oooo ; It is equivalent to 111100001111
oooo****oooo ; It is equivalent to 1111xxxx1111