Generally we tend not to provide finished solutions in the belief that it is better to have some guidence and then solve the problem yourself - that way you learn how things work and how to do it and you understand what has been done.
BUT in this case I will make an exception for a fellow student at Edghill (I graduated 10 years ago - Say Hi to Charles for me :0)
I am not familiar with he workings of the logicator software but you can either use the Picaxe flow chart software or alternativly this basic code should do much of what you are looking for.
'===assumes that pin 3 is the main wire contact
'=== Pin 2 is the finish contact
'=== connect handle to +5 Volts.
'=== Output 0 LED
'=== Output 4 tune.
start:
low 0 'resets the LED for a new game
Main:
if pin3=1 then count 'checks the main wire for contact
if pin 2=1 then winner 'checks the end game contact for a winner
goto main ' go round the loop again
count:
B0=B0+1 'counts the touches
if B0=2 then endgame 'if touched twice ends game
goto main ' jumps back to check if touched once only
endgame:
High 0 'puts LED on
b0=0 'resets B0 for next game
resetsignal:
if pin2=1 then start 'holds the game until reset bytouching the finish contact
goto resetsignal
winner:
Play tune - You have to work this out for yourself - See the manuals.
b0=0
goto main
This is untested and you might want to add a reset switch to start the game again.
PS remember your pupils want you to tell them the answer but will benifit from working it out for themselves.
Edited by - rickharris on 10/20/2005 7:56:14 PM