gyro boy improvements (#236)

gyro boy improvements
This commit is contained in:
Peli de Halleux
2018-01-13 08:31:10 -08:00
committed by GitHub
parent 25fded6afb
commit 0b763978f2
13 changed files with 400 additions and 38 deletions

View File

@ -30,6 +30,16 @@ namespace control {
reset() {
this.start = control.millis();
}
/**
* Pauses until the timer reaches the given amount of milliseconds
* @param ms how long to pause for, eg: 5, 100, 200, 500, 1000, 2000
*/
//% blockId=timerPauseUntil block="%timer|pause until (ms) %ms"
pauseUntil(ms: number) {
const remaining = this.millis() - ms;
loops.pause(Math.max(0, remaining));
}
}
//% whenUsed fixedInstance block="timer 1"