light the way activities

This commit is contained in:
Peli de Halleux
2018-01-05 19:14:55 -08:00
parent 94c4e508fe
commit 931987468a
9 changed files with 78 additions and 19 deletions

View File

@ -223,15 +223,15 @@ namespace sensors {
}
}
//% whenUsed block="color 3" weight=90 fixedInstance jres=icons.port3
export const color3: ColorSensor = new ColorSensor(3)
//% whenUsed block="color 1" weight=95 fixedInstance jres=icons.port1
export const color1: ColorSensor = new ColorSensor(1)
//% whenUsed block="color 2" weight=90 fixedInstance jres=icons.port2
export const color2: ColorSensor = new ColorSensor(2)
//% whenUsed block="color 3" weight=90 fixedInstance jres=icons.port3
export const color3: ColorSensor = new ColorSensor(3)
//% whenUsed block="color 4" weight=90 fixedInstance jres=icons.port4
export const color4: ColorSensor = new ColorSensor(4)
}

View File

@ -6,10 +6,10 @@
"sensors.TouchSensor.onEvent|block": "on %sensor|%event",
"sensors.TouchSensor.pauseUntil|block": "pause until %sensor|%event",
"sensors.TouchSensor.wasPressed|block": "%sensor|was pressed",
"sensors.touchSensor1|block": "touch 1",
"sensors.touchSensor2|block": "touch 2",
"sensors.touchSensor3|block": "touch 3",
"sensors.touchSensor4|block": "touch 4",
"sensors.touch1|block": "touch 1",
"sensors.touch2|block": "touch 2",
"sensors.touch3|block": "touch 3",
"sensors.touch4|block": "touch 4",
"{id:category}Sensors": "Sensors",
"{id:group}Touch Sensor": "Touch Sensor"
}

View File

@ -1,8 +1,8 @@
sensors.touchSensor1.onEvent(TouchSensorEvent.Pressed, function () {
sensors.touch1.onEvent(TouchSensorEvent.Pressed, function () {
})
sensors.touchSensor2.onEvent(TouchSensorEvent.Bumped, function () {
sensors.touch2.onEvent(TouchSensorEvent.Bumped, function () {
})
sensors.touchSensor3.onEvent(TouchSensorEvent.Released, function () {
sensors.touch3.onEvent(TouchSensorEvent.Released, function () {
})
sensors.touchSensor4.isPressed();
sensors.touchSensor4.wasPressed();
sensors.touch4.isPressed();
sensors.touch4.wasPressed();

View File

@ -102,11 +102,11 @@ namespace sensors {
}
//% whenUsed block="touch 1" weight=95 fixedInstance jres=icons.port1
export const touchSensor1: TouchSensor = new TouchSensor(1)
export const touch1: TouchSensor = new TouchSensor(1)
//% whenUsed block="touch 2" weight=95 fixedInstance jres=icons.port2
export const touchSensor2: TouchSensor = new TouchSensor(2)
export const touch2: TouchSensor = new TouchSensor(2)
//% whenUsed block="touch 3" weight=95 fixedInstance jres=icons.port3
export const touchSensor3: TouchSensor = new TouchSensor(3)
export const touch3: TouchSensor = new TouchSensor(3)
//% whenUsed block="touch 4" weight=95 fixedInstance jres=icons.port4
export const touchSensor4: TouchSensor = new TouchSensor(4)
export const touch4: TouchSensor = new TouchSensor(4)
}