fix play ringtone (#MINI-32)
This commit is contained in:
@ -9,9 +9,13 @@ namespace music {
|
||||
//% help=music/play-tone weight=90
|
||||
//% blockId=device_play_note block="play|tone %note=device_note|for %duration=device_beat" icon="\uf025" blockGap=8
|
||||
//% parts="speaker" async
|
||||
void playTone(int freqency, int ms) {
|
||||
uBit.soundmotor.soundOn(freqency);
|
||||
if(ms > 0) uBit.sleep(ms);
|
||||
uBit.soundmotor.soundOff();
|
||||
void playTone(int frequency, int ms) {
|
||||
if(frequency > 0) uBit.soundmotor.soundOn(frequency);
|
||||
else uBit.soundmotor.soundOff();
|
||||
if(ms > 0) {
|
||||
uBit.sleep(ms);
|
||||
uBit.soundmotor.soundOff();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user