Add motor slider control

This commit is contained in:
Sam El-Husseini
2017-12-28 13:23:30 -08:00
parent d7f46c0fb5
commit cbe68b3199
4 changed files with 228 additions and 6 deletions

View File

@ -73,8 +73,17 @@ namespace pxsim {
this.started = true;
}
isInput() {
// TODO: figure out if a motor is in an input or output state
return true;
}
setSpeedAsInput(speed: number) {
this.speed = speed;
}
updateState(elapsed: number) {
console.log(`motor: ${elapsed}ms - ${this.speed}% - ${this.angle}> - ${this.tacho}|`)
//console.log(`motor: ${elapsed}ms - ${this.speed}% - ${this.angle}> - ${this.tacho}|`)
const interval = Math.min(20, elapsed);
let t = 0;
while(t < elapsed) {