From b029dcdfa65b076eac1f89c3973f96e2116743e1 Mon Sep 17 00:00:00 2001 From: Kier Palin Date: Tue, 10 Sep 2024 12:02:31 +0100 Subject: [PATCH] Renamed MagnetXSensor() to MagnetSensor. Code cleanup. --- app.ts | 5 +---- sensors.ts | 8 ++------ 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/app.ts b/app.ts index c164440..fb0a001 100644 --- a/app.ts +++ b/app.ts @@ -7,7 +7,6 @@ namespace microcode { version?: string } - /** * If an Arcade Shield is not present when starting MicroData that Microbit will enter DistributedLoggingProtocol. * It will show a :) on its LEDs and try to become a Target - where it will receive radio commands from a Commander Microbit (one with an Arcade Shield) @@ -21,11 +20,9 @@ namespace microcode { reportEvent("app.start") this.sceneManager = new SceneManager() - datalogger.includeTimestamp(FlashLogTimeStampFormat.None) - const arcadeShieldConnected = screenhelpers.displayPresent(); - if (arcadeShieldConnected) + if (screenhelpers.displayPresent()) this.pushScene(new Home(this)) else new DistributedLoggingProtocol(this, false); diff --git a/sensors.ts b/sensors.ts index d8d9e4c..7efbc91 100644 --- a/sensors.ts +++ b/sensors.ts @@ -386,8 +386,6 @@ namespace microcode { this.normalisedDataBuffer = [] } - - //------------------ // Factory Function: //------------------ @@ -412,7 +410,7 @@ namespace microcode { else if (name == "A. Pin 2" || name == "Analog Pin 2" || name == "AP2") return new AnalogPinP2Sensor(); else if (name == "Light" || name == "L") return new LightSensor(); else if (name == "Temp." || name == "Temperature" || name == "T") return new TemperatureSensor(); - else if (name == "Magnet" || name == "M") return new MagnetXSensor(); + else if (name == "Magnet" || name == "M") return new MagnetSensor(); else if (name == "Logo Pressed" || name == "Logo Press" || name == "LP") return new LogoPressSensor(); else if (name == "Volume" || name == "Microphone" || name == "V") return new VolumeSensor(); else if (name == "Compass" || name == "C") return new CompassHeadingSensor(); @@ -813,7 +811,7 @@ namespace microcode { /** * Micro-tesla reading of the magnet sensor on Dimension.Strength */ - export class MagnetXSensor extends Sensor { + export class MagnetSensor extends Sensor { constructor() {super()} public static getName(): string {return "Magnet"} @@ -821,10 +819,8 @@ namespace microcode { public static getReading(): number {return input.magneticForce(Dimension.Strength)} } - /** * Onboard Pitch or Roll sensor - * */ export class PitchSensor extends Sensor { constructor() {super()}