User manual
41
The PWM output is treated like a normal digital port in this example. This is necessary because
all four outputs A1 to A4 are needed for number input. After each complete input, the four LEDs
are deleted to give the observer as little information about the secret combination as possible.
Address
Command
Data
Comment
00
8
7
Page 7
01
4
3
A = 3
02
5
1
B = A
03
D
0
call 70
04
C
3
Skip if A=B
05
3
0
End
06
1
0
LEDs off
07
4
5
A = 5
08
5
1
B = A
09
D
0
call 70
0A
C
3
Skip if A=B
0B
3
0
End
0C
1
0
LEDs off
0D
4
2
A = 2
0E
5
1
B = A
0F
D
0
call 70
10
C
3
Skip if A=B
11
3
0
End
12
1
0
LEDs off
13
4
F
A = 15
14
5
9
PWM=A
15
3
0
End
87 43 51 D0 C3 30 10 45 51 D0 C3 30 10 42 51 D0 C3 30 10 4F 59 30
Listing 26: The number lock
21 Appendix
Listing of the example programmes
Address
Command
Data
Comment
00
6
4
A = Din
01
5
1
B = A