Skip to content

Commit

Permalink
remove jacdac
Browse files Browse the repository at this point in the history
  • Loading branch information
tballmsft committed Aug 31, 2024
1 parent fae97ff commit 2aa887b
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 65 deletions.
67 changes: 67 additions & 0 deletions jacdacSensors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
namespace microcode {
/**
* See modules.lightLevel1.lightLevel sensor from pxt-jacdac/jacdac-light-level.
* Overrides .isJacdac()
*/
export class JacdacLightSensor extends Sensor {
constructor() {super(); modules.lightLevel1.start()}

public static getName(): string {return "Jac Light"}
public static getRadioName(): string {return "JL"}
public static getReading(): number {return modules.lightLevel1.isConnected() ? modules.lightLevel1.lightLevel() : undefined}
public static isJacdac(): boolean {return true;}
}

/**
* See modules.distance1.distance sensor from pxt-jacdac/jacdac-distance.
* Overrides .isJacdac()
*/
export class JacdacDistanceSensor extends Sensor {
constructor() {super(); modules.distance1.start()}

public static getName(): string {return "Jac Dist"}
public static getRadioName(): string {return "JD"}
public static getReading(): number {return modules.distance1.isConnected() ? modules.distance1.distance() : undefined}
public static isJacdac(): boolean {return true;}
}

/**
* See modules.soilMoisture1.moisture sensor from pxt-jacdac/jacdac-soil-moisture.
* Overrides .isJacdac()
*/
export class JacdacSoilMoistureSensor extends Sensor {
constructor() {super(); modules.soilMoisture1.start()
}

public static getName(): string {return "Jac Moist"}
public static getRadioName(): string {return "JM"}
public static getReading(): number {return modules.soilMoisture1.isConnected() ? modules.soilMoisture1.moisture() : undefined}
public static isJacdac(): boolean {return true;}
}

/**
* See modules.flex1.bending sensor from pxt-jacdac/flex.
* Overrides .isJacdac()
*/
export class JacdacFlexSensor extends Sensor {
constructor() {super(); modules.flex1.start()}

public static getName(): string {return "Jac Flex"}
public static getRadioName(): string {return "JF"}
public static getReading(): number {return modules.flex1.isConnected() ? modules.flex1.bending() : undefined}
public static isJacdac(): boolean {return true;}
}

/**
* See modules.temperature1.temperature sensor from pxt-jacdac/temperature.
* Overrides .isJacdac()
*/
export class JacdacTemperatureSensor extends Sensor {
constructor() {super(); modules.temperature1.start()}

public static getName(): string {return "Jac Temp"}
public static getRadioName(): string {return "JT"}
public static getReading(): number {return modules.temperature1.isConnected() ? modules.temperature1.temperature() : undefined}
public static isJacdac(): boolean {return true;}
}
}
65 changes: 0 additions & 65 deletions sensors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -648,69 +648,4 @@ namespace microcode {
public static getMaximum(): number {return 255;}
}

/**
* See modules.lightLevel1.lightLevel sensor from pxt-jacdac/jacdac-light-level.
* Overrides .isJacdac()
*/
export class JacdacLightSensor extends Sensor {
constructor() {super(); modules.lightLevel1.start()}

public static getName(): string {return "Jac Light"}
public static getRadioName(): string {return "JL"}
public static getReading(): number {return modules.lightLevel1.isConnected() ? modules.lightLevel1.lightLevel() : undefined}
public static isJacdac(): boolean {return true;}
}

/**
* See modules.distance1.distance sensor from pxt-jacdac/jacdac-distance.
* Overrides .isJacdac()
*/
export class JacdacDistanceSensor extends Sensor {
constructor() {super(); modules.distance1.start()}

public static getName(): string {return "Jac Dist"}
public static getRadioName(): string {return "JD"}
public static getReading(): number {return modules.distance1.isConnected() ? modules.distance1.distance() : undefined}
public static isJacdac(): boolean {return true;}
}

/**
* See modules.soilMoisture1.moisture sensor from pxt-jacdac/jacdac-soil-moisture.
* Overrides .isJacdac()
*/
export class JacdacSoilMoistureSensor extends Sensor {
constructor() {super(); modules.soilMoisture1.start()
}

public static getName(): string {return "Jac Moist"}
public static getRadioName(): string {return "JM"}
public static getReading(): number {return modules.soilMoisture1.isConnected() ? modules.soilMoisture1.moisture() : undefined}
public static isJacdac(): boolean {return true;}
}

/**
* See modules.flex1.bending sensor from pxt-jacdac/flex.
* Overrides .isJacdac()
*/
export class JacdacFlexSensor extends Sensor {
constructor() {super(); modules.flex1.start()}

public static getName(): string {return "Jac Flex"}
public static getRadioName(): string {return "JF"}
public static getReading(): number {return modules.flex1.isConnected() ? modules.flex1.bending() : undefined}
public static isJacdac(): boolean {return true;}
}

/**
* See modules.temperature1.temperature sensor from pxt-jacdac/temperature.
* Overrides .isJacdac()
*/
export class JacdacTemperatureSensor extends Sensor {
constructor() {super(); modules.temperature1.start()}

public static getName(): string {return "Jac Temp"}
public static getRadioName(): string {return "JT"}
public static getReading(): number {return modules.temperature1.isConnected() ? modules.temperature1.temperature() : undefined}
public static isJacdac(): boolean {return true;}
}
}

0 comments on commit 2aa887b

Please sign in to comment.