Skip to content

Commit

Permalink
Fix setNextTempo() + test.ts issues
Browse files Browse the repository at this point in the history
  • Loading branch information
GrandpaBond committed Nov 17, 2023
1 parent 7122950 commit 7d5a557
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion flexFX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ namespace flexFX {
//% group="Play-list"
//% weight=210
export function setNextTempo(bpm: number) {
tickMs = 60000/bpm;
tickMs = 15000/bpm; // = (60*1000) / (4*bpm)
}


Expand Down
3 changes: 1 addition & 2 deletions pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"flexFX.ts",
"README.md",
"tutorial-info-cache.json",
"main.ts",
"temp.md"
"main.ts"
],
"testFiles": [
"test.ts"
Expand Down
6 changes: 5 additions & 1 deletion test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,19 @@ pause(2000);

// check asynchrony of tunes
basic.showIcon(IconNames.Target);
flexFX.playTune("birthday", "hum", false, 200, 6000, -24);
flexFX.playTune("birthday", "hum", false, 200, 12000, -5);
basic.showNumber(flexFX.waitingToPlay());
pause(1000);
flexFX.startPlaying();
while (flexFX.isActive()) {
images.iconImage(IconNames.StickFigure).showImage(-1, 150);
pause(200);
images.iconImage(IconNames.StickFigure).showImage(0, 150);
pause(200);
images.iconImage(IconNames.StickFigure).showImage(1, 150);
pause(200);
images.iconImage(IconNames.StickFigure).showImage(0, 150);
pause(200);
}

basic.showIcon(IconNames.Yes);
Expand Down

0 comments on commit 7d5a557

Please sign in to comment.