Device 16F628A
Xtal 10
Config HS_OSC,_
WDT_OFF,_
PWRTE_ON,_
MCLRE_OFF,_
BODEN_OFF,_
LVP_OFF,_
CP_OFF
All_Digital true
Symbol PIN = PORTB.0
Symbol S1 = PORTA.0
Symbol R = 0
Symbol C = 82
Symbol Db0 = 85
Symbol D = 87
Symbol Eb = 89
Symbol E = 92
Symbol F = 94
Symbol Gb = 95
Symbol G = 97
Symbol Ab1 = 99
Symbol A1 = 73
Symbol Bb1 = 76
Symbol BE1 = 79
Symbol C1 = 82
Symbol Db1 = 85
Symbol D1 = 87
Symbol Eb1 = 89
Symbol E1 = 92
Symbol F1 = 94
Symbol Gb1 = 95
Symbol G1 = 97
Symbol Ab2 = 99
Symbol A2 = 101
Symbol Bb2 = 102
Symbol BE2 = 104
Symbol C2 = 105
Symbol Db2 = 106
Symbol D2 = 108
Symbol E2 = 110
Symbol F2 = 111
Symbol Gb2 = 112
Symbol G2 = 113
Symbol Bb3 = 115
Symbol Bm3 = 116
Symbol C3 = 117
Symbol D3 = 118
DelayMS 500
Clear
PORTA = %000000
TRISA = %111111
PORTB = %000000
TRISB = %000000
START:
If S1 = 1 Then GoTo SONG1
GoTo START
SONG1:
Sound PIN,[G,80,D2,80,C2,20,BE2,20,A2,20,G2,80,D2,80,C2,20,BE2,20,A2,20,G2,80,D2,80,C2,20,BE2,20,C2,20,A2,80]
DelayMS 1000
GoTo SONG2
SONG2:
Sound PIN,[F,80,R,2,F,70,R,2,F,10,R,2,F,80,Ab1,60,R,2,G,10,R,2,G,60,R,5,F,10,R,2,F,50,R,2,E,20,R,1,F,40]
DelayMS 1000
GoTo SONG3
SONG3:
Sound PIN,[F2,40,R,2,C2,20,R,2,C2,20,R,5,D2,50,R,3,C2,30,R,40,E2,40,F2,50]
DelayMS 1000
GoTo SONG4
SONG4:
Sound PIN,[Db2,20,Gb2,20,Bb3,15,C3,30,R,5,Bb3,20,C3,75]
DelayMS 1000
GoTo SONG5
SONG5:
Sound PIN,[C2,30,R,10,C2,30,R,10,C2,80,R,3,C2,20,BE2,30,A2,20,BE2,30,C2,20,D2,30,R,5,C2,10,E2,30,R,15,E2,30,R,15,E2,80]
DelayMS 1000
GoTo START
End