support for multiple simulated servos

This commit is contained in:
Peli de Halleux
2016-11-07 22:25:19 -08:00
parent 633522c800
commit 7117ba771e
2 changed files with 12 additions and 7 deletions

View File

@ -14,7 +14,7 @@ namespace pxsim {
radioState: RadioState;
// TODO: not singletons
neopixelState: NeoPixelState;
microServoState: MicroServoState;
servosState: MicroServosState;
fileSystem: FileSystemState;
constructor() {
@ -62,7 +62,12 @@ namespace pxsim {
this.builtinParts["lightsensor"] = this.lightSensorState = new LightSensorState();
this.builtinParts["compass"] = this.compassState = new CompassState();
this.builtinParts["neopixel"] = this.neopixelState = new NeoPixelState();
this.builtinParts["microservo"] = this.microServoState = new MicroServoState();
this.builtinParts["microservo"] = this.servosState = new MicroServosState({
"P0": DAL.MICROBIT_ID_IO_P0,
"P1": DAL.MICROBIT_ID_IO_P1,
"P2": DAL.MICROBIT_ID_IO_P2,
"P3": DAL.MICROBIT_ID_IO_P3
});
this.builtinVisuals["buttonpair"] = () => new visuals.ButtonPairView();
this.builtinVisuals["ledmatrix"] = () => new visuals.LedMatrixView();