Experiments for the Thames and Kosmos Computer Systems Engineering Kit
Programm simon_cp.k

Rem Memory
LB: startPdir = 19
A = Uin
A = A Shr 1
A = A Shr 1
D = A
L7: autoplayDelay = 100
A = D
B = 25
If A > B Goto L9: startuser
A = A + 1
D = A
B = A
A = [B+]
B = 128
If A < B Goto L8: auto2
C = 255
Gosub L2: light1
Goto L7: autoplay
L8: auto2C = 127
Gosub L3: light2
Goto L7: autoplay
L9: startuserA = Uin
A = A Shr 1
A = A Shr 1
D = A
LA: nextkeyA = D
B = 26
If A = B Goto L6: finale
A = A + 1
D = A
L1: buttons A = Portin
A = Not A
B = 12
A = A And B
B = 4
If A = B Goto L4: button1
B = 8
If A = B Goto L5: button2
C = 0
Goto L1: buttons
L4: button1Gosub LC: getram
If A > B Goto LB: start
C = 255
Gosub L2: light1
Goto LA: nextkey
L2: light1Portout = 45
Delay = 1
Portout = 60
C*Goto L2: light1
Return
L5: button2Gosub LC: getram
If A < B Goto LB: start
C = 127
Gosub L3: light2
Goto LA: nextkey
L3: light2Portout = 46
Delay = 2
Portout = 60
C*Goto L3: light2
Return
LC: getramA = C
B = 1
If A = B Goto L1: buttons
C = 1
A = D
B = A
A = [B+]
B = A
A = 128
Return
L6: finalePortout = 45
Delay = 180
Portout = 62
Delay = 180
Goto L6: finale
End

Download Program
Brain Training
One of the first "Game Consoles" called Simon had 4 large illuminated buttons that had to be pushed in the same order that the random generator showed. The game can still be found today e.g. on some cell phones.

With the Thames and Kosmos Microcontroller Kit we can build a 2 button version of this game.
The Knob controlls the skill level. If you push the wrong button the microcontroller repeats the entire sequence. - Until you finally get it right and will be rewarded with applause and blinking LEDs.
Then turn up the knob a little and push the third button for a reset - what third button? There were only two included in the kit! Well, here is an easy way to make an additional button, or you can just leave it out and switch the microcontroller off and on for a reset.
Büroklammertaste
The program uses up the entire memory and all labels of the microcontroller. That's why an automatic increase of the skill level was not possible. - Maybe somebody has an idea how to improve the program? After all even the 2.2MΩ-Resistor is used for saving memory. ;-)
Microcontroller Memory
Further experiments can be found on the website of the author of the microcontroller-manual Burkhard Kainka: www.b-kainka.de (external link, German site)

If you know other websites containing new experiments for the Thames and Kosmos microcontroller, please send a message to:
clemens@secondpage.de
header