User manual
466
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
Sound_Play(880, 1000)
while TRUE ‘ endless loop
if (Button(PORTB,7,1,1)) then ‘ If PORTB.7 is pressed play Tone1
Tone1()
while (RB7_bit <> 0) ‘ Wait for button to be released
nop
wend
end if
if (Button(PORTB,6,1,1)) then ‘ If PORTB.6 is pressed play Tone1
Tone2()
while (RB6_bit <> 0) ‘ Wait for button to be released
nop
wend
end if
if (Button(PORTB,5,1,1)) then ‘ If PORTB.5 is pressed play Tone1
Tone3()
while (RB5_bit <> 0) ‘ Wait for button to be released
nop
wend
end if
if (Button(PORTB,4,1,1)) then ‘ If PORTB.4 is pressed play Tone1
Melody2()
while (RB4_bit <> 0) ‘ Wait for button to be released
nop
wend
end if
if (Button(PORTB,3,1,1)) then ‘ If PORTB.3 is pressed play Tone1
Melody()
while (RB3_bit <> 0) ‘ Wait for button to be released
nop
wend
end if
wend
end.