Hi,
I decided to try and play with the Tune command as I had a piezo that's been in the box for a while and never used. I wrote it into the "Win" sequence in the code below. However, when it plays in the simulator, it sets output 0 and output 2 to high? This is not good as 0 is the buzzer that sounds when you lose and 2 is one of the red led's that light when you lose.
I cant figure out why. Can anybody help?
Thanks
I decided to try and play with the Tune command as I had a piezo that's been in the box for a while and never used. I wrote it into the "Win" sequence in the code below. However, when it plays in the simulator, it sets output 0 and output 2 to high? This is not good as 0 is the buzzer that sounds when you lose and 2 is one of the red led's that light when you lose.
I cant figure out why. Can anybody help?
Thanks
Code:
Main: 'the main loop
low 4
low 5
low 0
low 1
low 2
if pin0 = 1 then lose
if pin1 = 1 then win
goto main
lose: 'lose sequence
pause 100
high 0
high 1 : high 2
pause 250
low 1 : low 2
pause 250
high 1 : high 2
pause 250
low 1 : low 2
pause 250
high 1 : high 2
pause 250
low 1 : low 2
pause 250
high 1 : high 2
pause 250
low 1 : low 2
pause 250
high 1 : high 2
pause 250
low 1 : low 2
pause 250
high 1 : high 2
pause 250
low 1 : low 2
pause 250
high 1 : high 2
pause 250
low 1 : low 2
pause 250
high 1 : high 2
pause 250
low 1 : low 2
pause 250
high 1 : high 2
pause 250
low 1 : low 2
pause 250
high 1 : high 2
pause 250
low 1 : low 2
pause 250
high 1 : high 2
low 0
goto startagain
startagain: 'awaiting reset
if pin2 = 1 then main
goto startagain
win: 'win sequence
pause 100
high 4
high 5
tune 3, 5, ($75,$75,$75,$FA,$C5,$43,$42,$40,$CA,$05,$43,$42,$40,
$CA,$05,$43,$42,$43,$C0,$3C,$75,$75,$75,$FA,$C5,$43,$42,$40,$CA,
$05,$43,$42,$40,$CA,$05,$43,$42,$43,$C0)
goto startagain
Last edited: