try to use uBit.soundmotor sound functions

This commit is contained in:
Matthias L. Jugel
2016-10-27 15:51:42 +02:00
parent a4ba24d6ef
commit e0735188fa
4 changed files with 61 additions and 276 deletions

9
libs/core/music.cpp Normal file
View File

@ -0,0 +1,9 @@
#include "ksbit.h"
namespace music {
void playTone(int freqency, int ms) {
uBit.soundmotor.Sound_On(freqency);
if(ms > 0) uBit.sleep(ms);
uBit.soundmotor.Sound_Off();
}
}