@ -32,86 +32,85 @@
|
|||||||
"TouchSensorEvent.Released|block": "released",
|
"TouchSensorEvent.Released|block": "released",
|
||||||
"UltrasonicSensorEvent.ObjectDetected|block": "object detected",
|
"UltrasonicSensorEvent.ObjectDetected|block": "object detected",
|
||||||
"UltrasonicSensorEvent.ObjectNear|block": "object near",
|
"UltrasonicSensorEvent.ObjectNear|block": "object near",
|
||||||
"brick.Button.isPressed|block": "%button|is pressed",
|
"brick.Button.isPressed|block": "`icons.brickButtons` %button|is pressed",
|
||||||
"brick.Button.onEvent|block": "on %button|%event",
|
"brick.Button.onEvent|block": "on `icons.brickButtons` %button|%event",
|
||||||
"brick.Button.wasPressed|block": "%button|was pressed",
|
"brick.Button.wasPressed|block": "`icons.brickButtons` %button|was pressed",
|
||||||
"brick._imagePicker|block": "%image",
|
"brick.buttonDown|block": "down",
|
||||||
"brick.buttonDown|block": "button down",
|
"brick.buttonEnter|block": "enter",
|
||||||
"brick.buttonEnter|block": "button enter",
|
"brick.buttonLeft|block": "left",
|
||||||
"brick.buttonLeft|block": "button left",
|
"brick.buttonRight|block": "right",
|
||||||
"brick.buttonRight|block": "button right",
|
"brick.buttonUp|block": "up",
|
||||||
"brick.buttonUp|block": "button up",
|
|
||||||
"brick.pattern|block": "%pattern",
|
"brick.pattern|block": "%pattern",
|
||||||
"brick.print|block": "print %text| at x: %x| y: %y",
|
"brick.print|block": "`icons.brickDisplay` print %text| at x: %x| y: %y",
|
||||||
"brick.setPixel|block": "set pixel %on| at x: %x| y: %y",
|
"brick.setPixel|block": "`icons.brickDisplay` set pixel %on| at x: %x| y: %y",
|
||||||
"brick.setStatusLight|block": "set status light %pattern=led_pattern",
|
"brick.setStatusLight|block": "set `icons.brickButtons` to %pattern=led_pattern",
|
||||||
"brick.showImage|block": "show image %image=scren_image_picker",
|
"brick.showImage|block": "show image %image=scren_image_picker",
|
||||||
"brick|block": "brick",
|
"brick|block": "brick",
|
||||||
"control.raiseEvent|block": "raise event|from %src|with value %value",
|
"control.raiseEvent|block": "raise event|from %src|with value %value",
|
||||||
"control|block": "control",
|
"control|block": "control",
|
||||||
"motors.Motor.count|block": "%motor|count",
|
"motors.Motor.count|block": "`icons.motorLarge` %motor|count",
|
||||||
"motors.Motor.move|block": "move %motor|by %angle|degrees at %power|%",
|
"motors.Motor.move|block": "move `icons.motorLarge` %motor|by %angle|degrees at %power|%",
|
||||||
"motors.Motor.power|block": "power %motor|to %power|%",
|
"motors.Motor.power|block": "power `icons.motorLarge` %motor|to %power|%",
|
||||||
"motors.Motor.setBrake|block": "set %motor|brake %brake",
|
"motors.Motor.setBrake|block": "set `icons.motorLarge` %motor|brake %brake",
|
||||||
"motors.Motor.setReversed|block": "set %motor|reversed %reversed",
|
"motors.Motor.setReversed|block": "set `icons.motorLarge` %motor|reversed %reversed",
|
||||||
"motors.Motor.speed|block": "%motor|speed",
|
"motors.Motor.speed|block": "`icons.motorLarge` %motor|speed",
|
||||||
"motors.Motor.stop|block": "stop %motor",
|
"motors.Motor.stop|block": "stop `icons.motorLarge` %motor",
|
||||||
"motors.Motor.tachoCount|block": "%motor|tacho count",
|
"motors.Motor.tachoCount|block": "`icons.motorLarge` %motor|tacho count",
|
||||||
"motors.largeMotorA|block": "large motor A",
|
"motors.largeMotorA|block": "large A",
|
||||||
"motors.largeMotorB|block": "large motor B",
|
"motors.largeMotorB|block": "large B",
|
||||||
"motors.largeMotorC|block": "large motor C",
|
"motors.largeMotorC|block": "large C",
|
||||||
"motors.largeMotorD|block": "large motor D",
|
"motors.largeMotorD|block": "large D",
|
||||||
"motors.mediumMotorA|block": "medium motor A",
|
"motors.mediumMotorA|block": "medium A",
|
||||||
"motors.mediumMotorB|block": "medium motor B",
|
"motors.mediumMotorB|block": "medium B",
|
||||||
"motors.mediumMotorC|block": "medium motor C",
|
"motors.mediumMotorC|block": "medium C",
|
||||||
"motors.mediumMotorD|block": "medium motor D",
|
"motors.mediumMotorD|block": "medium D",
|
||||||
"motors.stopAllMotors|block": "stop all motors",
|
"motors.stopAllMotors|block": "stop all `icons.motorLarge`",
|
||||||
"motors|block": "motors",
|
"motors|block": "motors",
|
||||||
"output|block": "output",
|
"output|block": "output",
|
||||||
"screen|block": "screen",
|
"screen|block": "screen",
|
||||||
"sensors.ColorSensor.ambientLight|block": "%color| ambient light",
|
"sensors.ColorSensor.ambientLight|block": "`icons.colorSensor` %color| ambient light",
|
||||||
"sensors.ColorSensor.color|block": "%color| color",
|
"sensors.ColorSensor.color|block": "`icons.colorSensor` %color| color",
|
||||||
"sensors.ColorSensor.onColorDetected|block": "on %sensor|detected %color",
|
"sensors.ColorSensor.onColorDetected|block": "on `icons.colorSensor` %sensor|detected %color",
|
||||||
"sensors.ColorSensor.reflectedLight|block": "%color| reflected light",
|
"sensors.ColorSensor.reflectedLight|block": "`icons.colorSensor` %color| reflected light",
|
||||||
"sensors.GyroSensor.angle|block": "%sensor|angle",
|
"sensors.GyroSensor.angle|block": "`icons.gyroSensor` %sensor|angle",
|
||||||
"sensors.GyroSensor.rate|block": "%sensor|rotation rate",
|
"sensors.GyroSensor.rate|block": "`icons.gyroSensor` %sensor|rotation rate",
|
||||||
"sensors.InfraredSensor.on|block": "on %sensor|%event",
|
"sensors.InfraredSensor.on|block": "on `icons.infraredSensor` %sensor|%event",
|
||||||
"sensors.InfraredSensor.proximity|block": "%infrared|proximity",
|
"sensors.InfraredSensor.proximity|block": "`icons.infraredSensor` %infrared|proximity",
|
||||||
"sensors.InfraredSensor.remoteCommand|block": "%infrared|remote command",
|
"sensors.InfraredSensor.remoteCommand|block": "`icons.infraredSensor` %infrared|remote command",
|
||||||
"sensors.InfraredSensor.wait|block": "wait %sensor|for %event",
|
"sensors.InfraredSensor.wait|block": "wait `icons.infraredSensor` %sensor|for %event",
|
||||||
"sensors.RemoteInfraredBeaconButton.isPressed|block": "%button|is pressed",
|
"sensors.RemoteInfraredBeaconButton.isPressed|block": "`icons.infraredSensor` %button|is pressed",
|
||||||
"sensors.RemoteInfraredBeaconButton.onEvent|block": "on %button|%event",
|
"sensors.RemoteInfraredBeaconButton.onEvent|block": "on `icons.infraredSensor` %button|%event",
|
||||||
"sensors.RemoteInfraredBeaconButton.wasPressed|block": "%button|was pressed",
|
"sensors.RemoteInfraredBeaconButton.wasPressed|block": "`icons.infraredSensor` %button|was pressed",
|
||||||
"sensors.TouchSensor.isTouched|block": "%sensor|is touched",
|
"sensors.TouchSensor.isTouched|block": "`icons.touchSensor` %sensor|is touched",
|
||||||
"sensors.TouchSensor.onEvent|block": "on %sensor|%event",
|
"sensors.TouchSensor.onEvent|block": "on `icons.touchSensor` %sensor|%event",
|
||||||
"sensors.UltraSonicSensor.distance|block": "%sensor|distance",
|
"sensors.UltraSonicSensor.distance|block": "`icons.ultrasonicSensor` %sensor|distance",
|
||||||
"sensors.UltraSonicSensor.on|block": "on %sensor|%event",
|
"sensors.UltraSonicSensor.on|block": "on `icons.ultrasonicSensor` %sensor|%event",
|
||||||
"sensors.UltraSonicSensor.wait|block": "wait %sensor|for %event",
|
"sensors.UltraSonicSensor.wait|block": "wait `icons.ultrasonicSensor` %sensor|for %event",
|
||||||
"sensors.color1|block": "color sensor 1",
|
"sensors.color1|block": "1",
|
||||||
"sensors.color2|block": "color sensor 2",
|
"sensors.color2|block": "2",
|
||||||
"sensors.color3|block": "color sensor 3",
|
"sensors.color3|block": "3",
|
||||||
"sensors.color4|block": "color sensor 4",
|
"sensors.color4|block": "4",
|
||||||
"sensors.gyro1|block": "gyro sensor 1",
|
"sensors.gyro1|block": "1",
|
||||||
"sensors.gyro2|block": "gyro sensor 2",
|
"sensors.gyro2|block": "2",
|
||||||
"sensors.gyro3|block": "gyro sensor 3",
|
"sensors.gyro3|block": "3",
|
||||||
"sensors.gyro4|block": "gyro sensor 4",
|
"sensors.gyro4|block": "4",
|
||||||
"sensors.infraredSensor1|block": "infrared sensor 1",
|
"sensors.infraredSensor1|block": "1",
|
||||||
"sensors.infraredSensor2|block": "infrared sensor 2",
|
"sensors.infraredSensor2|block": "2",
|
||||||
"sensors.infraredSensor3|block": "infrared sensor 3",
|
"sensors.infraredSensor3|block": "3",
|
||||||
"sensors.infraredSensor4|block": "infrared sensor 4",
|
"sensors.infraredSensor4|block": "4",
|
||||||
"sensors.remoteButtonBottomLeft|block": "remote button bottom-left",
|
"sensors.remoteButtonBottomLeft|block": "bottom-left",
|
||||||
"sensors.remoteButtonBottomRight|block": "remote button bottom-right",
|
"sensors.remoteButtonBottomRight|block": "bottom-right",
|
||||||
"sensors.remoteButtonCenter|block": "remote button center",
|
"sensors.remoteButtonCenter|block": "center",
|
||||||
"sensors.remoteButtonTopLeft|block": "remote button top-left",
|
"sensors.remoteButtonTopLeft|block": "top-left",
|
||||||
"sensors.remoteButtonTopRight|block": "remote button top-right",
|
"sensors.remoteButtonTopRight|block": "top-right",
|
||||||
"sensors.touchSensor1|block": "touch sensor 1",
|
"sensors.touchSensor1|block": "1",
|
||||||
"sensors.touchSensor2|block": "touch sensor 2",
|
"sensors.touchSensor2|block": "2",
|
||||||
"sensors.touchSensor3|block": "touch sensor 3",
|
"sensors.touchSensor3|block": "3",
|
||||||
"sensors.touchSensor4|block": "touch sensor 4",
|
"sensors.touchSensor4|block": "4",
|
||||||
"sensors.ultrasonic1|block": "ultrasonic sensor 1",
|
"sensors.ultrasonic1|block": "1",
|
||||||
"sensors.ultrasonic2|block": "ultrasonic sensor 2",
|
"sensors.ultrasonic2|block": "2",
|
||||||
"sensors.ultrasonic3|block": "ultrasonic sensor 3",
|
"sensors.ultrasonic3|block": "3",
|
||||||
"sensors.ultrasonic4|block": "ultrasonic sensor 4",
|
"sensors.ultrasonic4|block": "4",
|
||||||
"sensors|block": "sensors",
|
"sensors|block": "sensors",
|
||||||
"serial|block": "serial",
|
"serial|block": "serial",
|
||||||
"{id:category}Brick": "Brick",
|
"{id:category}Brick": "Brick",
|
||||||
|
@ -84,7 +84,7 @@ namespace brick {
|
|||||||
* @param button the button to query the request
|
* @param button the button to query the request
|
||||||
*/
|
*/
|
||||||
//% help=input/button/is-pressed
|
//% help=input/button/is-pressed
|
||||||
//% block="%button|is pressed"
|
//% block="`icons.brickButtons` %button|is pressed"
|
||||||
//% blockId=buttonIsPressed
|
//% blockId=buttonIsPressed
|
||||||
//% parts="brick"
|
//% parts="brick"
|
||||||
//% blockNamespace=brick
|
//% blockNamespace=brick
|
||||||
@ -99,7 +99,7 @@ namespace brick {
|
|||||||
* @param button the button to query the request
|
* @param button the button to query the request
|
||||||
*/
|
*/
|
||||||
//% help=input/button/was-pressed
|
//% help=input/button/was-pressed
|
||||||
//% block="%button|was pressed"
|
//% block="`icons.brickButtons` %button|was pressed"
|
||||||
//% blockId=buttonWasPressed
|
//% blockId=buttonWasPressed
|
||||||
//% parts="brick"
|
//% parts="brick"
|
||||||
//% blockNamespace=brick
|
//% blockNamespace=brick
|
||||||
@ -118,7 +118,7 @@ namespace brick {
|
|||||||
* @param body code to run when the event is raised
|
* @param body code to run when the event is raised
|
||||||
*/
|
*/
|
||||||
//% help=input/button/on-event
|
//% help=input/button/on-event
|
||||||
//% blockId=buttonEvent block="on %button|%event"
|
//% blockId=buttonEvent block="on `icons.brickButtons` %button|%event"
|
||||||
//% parts="brick"
|
//% parts="brick"
|
||||||
//% blockNamespace=brick
|
//% blockNamespace=brick
|
||||||
//% weight=99 blockGap=8
|
//% weight=99 blockGap=8
|
||||||
@ -180,31 +180,31 @@ namespace brick {
|
|||||||
/**
|
/**
|
||||||
* Enter button on the EV3 Brick.
|
* Enter button on the EV3 Brick.
|
||||||
*/
|
*/
|
||||||
//% whenUsed block="button enter" weight=95 fixedInstance
|
//% whenUsed block="enter" weight=95 fixedInstance
|
||||||
export const buttonEnter: Button = new DevButton(DAL.BUTTON_ID_ENTER)
|
export const buttonEnter: Button = new DevButton(DAL.BUTTON_ID_ENTER)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Left button on the EV3 Brick.
|
* Left button on the EV3 Brick.
|
||||||
*/
|
*/
|
||||||
//% whenUsed block="button left" weight=95 fixedInstance
|
//% whenUsed block="left" weight=95 fixedInstance
|
||||||
export const buttonLeft: Button = new DevButton(DAL.BUTTON_ID_LEFT)
|
export const buttonLeft: Button = new DevButton(DAL.BUTTON_ID_LEFT)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Right button on the EV3 Brick.
|
* Right button on the EV3 Brick.
|
||||||
*/
|
*/
|
||||||
//% whenUsed block="button right" weight=94 fixedInstance
|
//% whenUsed block="right" weight=94 fixedInstance
|
||||||
export const buttonRight: Button = new DevButton(DAL.BUTTON_ID_RIGHT)
|
export const buttonRight: Button = new DevButton(DAL.BUTTON_ID_RIGHT)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Up button on the EV3 Brick.
|
* Up button on the EV3 Brick.
|
||||||
*/
|
*/
|
||||||
//% whenUsed block="button up" weight=95 fixedInstance
|
//% whenUsed block="up" weight=95 fixedInstance
|
||||||
export const buttonUp: Button = new DevButton(DAL.BUTTON_ID_UP)
|
export const buttonUp: Button = new DevButton(DAL.BUTTON_ID_UP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Down button on the EV3 Brick.
|
* Down button on the EV3 Brick.
|
||||||
*/
|
*/
|
||||||
//% whenUsed block="button down" weight=95 fixedInstance
|
//% whenUsed block="down" weight=95 fixedInstance
|
||||||
export const buttonDown: Button = new DevButton(DAL.BUTTON_ID_DOWN)
|
export const buttonDown: Button = new DevButton(DAL.BUTTON_ID_DOWN)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ namespace brick {
|
|||||||
* Set lights.
|
* Set lights.
|
||||||
* @param pattern the lights pattern to use.
|
* @param pattern the lights pattern to use.
|
||||||
*/
|
*/
|
||||||
//% blockId=setLights block="set status light %pattern=led_pattern"
|
//% blockId=setLights block="set `icons.brickButtons` to %pattern=led_pattern"
|
||||||
//% weight=100 group="Light"
|
//% weight=100 group="Light"
|
||||||
export function setStatusLight(pattern: number): void {
|
export function setStatusLight(pattern: number): void {
|
||||||
if (currPattern === pattern)
|
if (currPattern === pattern)
|
||||||
|
@ -59,7 +59,7 @@ namespace sensors {
|
|||||||
* @param handler the code to run when detected
|
* @param handler the code to run when detected
|
||||||
*/
|
*/
|
||||||
//% help=input/color/on-color-detected
|
//% help=input/color/on-color-detected
|
||||||
//% block="on %sensor|detected %color"
|
//% block="on `icons.colorSensor` %sensor|detected %color"
|
||||||
//% blockId=colorOnColorDetected
|
//% blockId=colorOnColorDetected
|
||||||
//% parts="colorsensor"
|
//% parts="colorsensor"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
@ -77,7 +77,7 @@ namespace sensors {
|
|||||||
* @param color the color sensor to query the request
|
* @param color the color sensor to query the request
|
||||||
*/
|
*/
|
||||||
//% help=input/color/ambient-light
|
//% help=input/color/ambient-light
|
||||||
//% block="%color| ambient light"
|
//% block="`icons.colorSensor` %color| ambient light"
|
||||||
//% blockId=colorGetAmbient
|
//% blockId=colorGetAmbient
|
||||||
//% parts="colorsensor"
|
//% parts="colorsensor"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
@ -93,7 +93,7 @@ namespace sensors {
|
|||||||
* @param color the color sensor to query the request
|
* @param color the color sensor to query the request
|
||||||
*/
|
*/
|
||||||
//% help=input/color/refelected-light
|
//% help=input/color/refelected-light
|
||||||
//% block="%color| reflected light"
|
//% block="`icons.colorSensor` %color| reflected light"
|
||||||
//% blockId=colorGetReflected
|
//% blockId=colorGetReflected
|
||||||
//% parts="colorsensor"
|
//% parts="colorsensor"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
@ -109,7 +109,7 @@ namespace sensors {
|
|||||||
* @param color the color sensor to query the request
|
* @param color the color sensor to query the request
|
||||||
*/
|
*/
|
||||||
//% help=input/color/color
|
//% help=input/color/color
|
||||||
//% block="%color| color"
|
//% block="`icons.colorSensor` %color| color"
|
||||||
//% blockId=colorGetColor
|
//% blockId=colorGetColor
|
||||||
//% parts="colorsensor"
|
//% parts="colorsensor"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
@ -121,15 +121,15 @@ namespace sensors {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//% whenUsed block="color sensor 3" weight=95 fixedInstance
|
//% whenUsed block="1" weight=95 fixedInstance
|
||||||
|
export const color1: ColorSensor = new ColorSensor(1)
|
||||||
|
|
||||||
|
//% whenUsed block="3" weight=90 fixedInstance
|
||||||
export const color3: ColorSensor = new ColorSensor(3)
|
export const color3: ColorSensor = new ColorSensor(3)
|
||||||
|
|
||||||
//% whenUsed block="color sensor 1" weight=95 fixedInstance
|
//% whenUsed block="2" weight=90 fixedInstance
|
||||||
export const color1: ColorSensor = new ColorSensor(1)
|
|
||||||
|
|
||||||
//% whenUsed block="color sensor 2" weight=95 fixedInstance
|
|
||||||
export const color2: ColorSensor = new ColorSensor(2)
|
export const color2: ColorSensor = new ColorSensor(2)
|
||||||
|
|
||||||
//% whenUsed block="color sensor 4" weight=95 fixedInstance
|
//% whenUsed block="4" weight=90 fixedInstance
|
||||||
export const color4: ColorSensor = new ColorSensor(4)
|
export const color4: ColorSensor = new ColorSensor(4)
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace sensors {
|
|||||||
* @param sensor the gyroscope to query the request
|
* @param sensor the gyroscope to query the request
|
||||||
*/
|
*/
|
||||||
//% help=input/gyro/angle
|
//% help=input/gyro/angle
|
||||||
//% block="%sensor|angle"
|
//% block="`icons.gyroSensor` %sensor|angle"
|
||||||
//% blockId=gyroGetAngle
|
//% blockId=gyroGetAngle
|
||||||
//% parts="gyroscope"
|
//% parts="gyroscope"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
@ -40,7 +40,7 @@ namespace sensors {
|
|||||||
* @param sensor the gyroscope to query the request
|
* @param sensor the gyroscope to query the request
|
||||||
*/
|
*/
|
||||||
//% help=input/gyro/rate
|
//% help=input/gyro/rate
|
||||||
//% block="%sensor|rotation rate"
|
//% block="`icons.gyroSensor` %sensor|rotation rate"
|
||||||
//% blockId=gyroGetRate
|
//% blockId=gyroGetRate
|
||||||
//% parts="gyroscope"
|
//% parts="gyroscope"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
@ -51,16 +51,16 @@ namespace sensors {
|
|||||||
return this.getNumber(NumberFormat.Int16LE, 0)
|
return this.getNumber(NumberFormat.Int16LE, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="gyro sensor 2"
|
|
||||||
export const gyro2: GyroSensor = new GyroSensor(2)
|
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="gyro sensor 1"
|
//% fixedInstance whenUsed block="1"
|
||||||
export const gyro1: GyroSensor = new GyroSensor(1)
|
export const gyro1: GyroSensor = new GyroSensor(1)
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="gyro sensor 3"
|
//% fixedInstance whenUsed block="2" weight=95
|
||||||
|
export const gyro2: GyroSensor = new GyroSensor(2)
|
||||||
|
|
||||||
|
//% fixedInstance whenUsed block="3"
|
||||||
export const gyro3: GyroSensor = new GyroSensor(3)
|
export const gyro3: GyroSensor = new GyroSensor(3)
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="gyro sensor 4"
|
//% fixedInstance whenUsed block="4"
|
||||||
export const gyro4: GyroSensor = new GyroSensor(4)
|
export const gyro4: GyroSensor = new GyroSensor(4)
|
||||||
}
|
}
|
||||||
|
33
libs/core/icons.jres
Normal file
@ -93,7 +93,7 @@ namespace sensors {
|
|||||||
* @param button the remote button to query the request
|
* @param button the remote button to query the request
|
||||||
*/
|
*/
|
||||||
//% help=input/remote-infrared-beacon/is-pressed
|
//% help=input/remote-infrared-beacon/is-pressed
|
||||||
//% block="%button|is pressed"
|
//% block="`icons.infraredSensor` %button|is pressed"
|
||||||
//% blockId=remoteButtonIsPressed
|
//% blockId=remoteButtonIsPressed
|
||||||
//% parts="remote"
|
//% parts="remote"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
@ -108,7 +108,7 @@ namespace sensors {
|
|||||||
* @param button the remote button to query the request
|
* @param button the remote button to query the request
|
||||||
*/
|
*/
|
||||||
//% help=input/remote-infrared-beacon/was-pressed
|
//% help=input/remote-infrared-beacon/was-pressed
|
||||||
//% block="%button|was pressed"
|
//% block="`icons.infraredSensor` %button|was pressed"
|
||||||
//% blockId=remotebuttonWasPressed
|
//% blockId=remotebuttonWasPressed
|
||||||
//% parts="remote"
|
//% parts="remote"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
@ -125,7 +125,7 @@ namespace sensors {
|
|||||||
* @param body code to run when the event is raised
|
* @param body code to run when the event is raised
|
||||||
*/
|
*/
|
||||||
//% help=input/remote-infrared-beacon/on-event
|
//% help=input/remote-infrared-beacon/on-event
|
||||||
//% blockId=remotebuttonEvent block="on %button|%event"
|
//% blockId=remotebuttonEvent block="on `icons.infraredSensor` %button|%event"
|
||||||
//% parts="remote"
|
//% parts="remote"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
//% weight=99 blockGap=8
|
//% weight=99 blockGap=8
|
||||||
@ -193,7 +193,7 @@ namespace sensors {
|
|||||||
* @param handler the code to run when detected
|
* @param handler the code to run when detected
|
||||||
*/
|
*/
|
||||||
//% help=input/infrared/on
|
//% help=input/infrared/on
|
||||||
//% block="on %sensor|%event"
|
//% block="on `icons.infraredSensor` %sensor|%event"
|
||||||
//% blockId=infraredOn
|
//% blockId=infraredOn
|
||||||
//% parts="infraredsensor"
|
//% parts="infraredsensor"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
@ -209,12 +209,12 @@ namespace sensors {
|
|||||||
* Waits for the event to occur
|
* Waits for the event to occur
|
||||||
*/
|
*/
|
||||||
//% help=input/ultrasonic/wait
|
//% help=input/ultrasonic/wait
|
||||||
//% block="wait %sensor|for %event"
|
//% block="wait `icons.infraredSensor` %sensor|for %event"
|
||||||
//% blockId=infraredwait
|
//% blockId=infraredwait
|
||||||
//% parts="infraredsensor"
|
//% parts="infraredsensor"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
//% weight=99 blockGap=8
|
//% weight=99 blockGap=8
|
||||||
//% group="Ultrasonic Sensor"
|
//% group="Infrared Sensor"
|
||||||
wait(event: InfraredSensorEvent) {
|
wait(event: InfraredSensorEvent) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
@ -224,7 +224,7 @@ namespace sensors {
|
|||||||
* @param ir the infrared sensor
|
* @param ir the infrared sensor
|
||||||
*/
|
*/
|
||||||
//% help=input/infrared/proximity
|
//% help=input/infrared/proximity
|
||||||
//% block="%infrared|proximity"
|
//% block="`icons.infraredSensor` %infrared|proximity"
|
||||||
//% blockId=infraredGetProximity
|
//% blockId=infraredGetProximity
|
||||||
//% parts="infrared"
|
//% parts="infrared"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
@ -240,7 +240,7 @@ namespace sensors {
|
|||||||
* @param ir the infrared sensor
|
* @param ir the infrared sensor
|
||||||
*/
|
*/
|
||||||
//% help=input/infrared/remote-command
|
//% help=input/infrared/remote-command
|
||||||
//% block="%infrared|remote command"
|
//% block="`icons.infraredSensor` %infrared|remote command"
|
||||||
//% blockId=infraredGetRemoteCommand
|
//% blockId=infraredGetRemoteCommand
|
||||||
//% parts="infrared"
|
//% parts="infrared"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
@ -258,46 +258,46 @@ namespace sensors {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="infrared sensor 1"
|
//% fixedInstance whenUsed block="1"
|
||||||
export const infraredSensor1: InfraredSensor = new InfraredSensor(1)
|
export const infraredSensor1: InfraredSensor = new InfraredSensor(1)
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="infrared sensor 2"
|
//% fixedInstance whenUsed block="2"
|
||||||
export const infraredSensor2: InfraredSensor = new InfraredSensor(2)
|
export const infraredSensor2: InfraredSensor = new InfraredSensor(2)
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="infrared sensor 3"
|
//% fixedInstance whenUsed block="3"
|
||||||
export const infraredSensor3: InfraredSensor = new InfraredSensor(3)
|
export const infraredSensor3: InfraredSensor = new InfraredSensor(3)
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="infrared sensor 4"
|
//% fixedInstance whenUsed block="4"
|
||||||
export const infraredSensor4: InfraredSensor = new InfraredSensor(4)
|
export const infraredSensor4: InfraredSensor = new InfraredSensor(4)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remote beacon (center) button.
|
* Remote beacon (center) button.
|
||||||
*/
|
*/
|
||||||
//% whenUsed block="remote button center" weight=95 fixedInstance
|
//% whenUsed block="center" weight=95 fixedInstance
|
||||||
export const remoteButtonCenter = irButton(IrRemoteButton.CenterBeacon)
|
export const remoteButtonCenter = irButton(IrRemoteButton.CenterBeacon)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remote top-left button.
|
* Remote top-left button.
|
||||||
*/
|
*/
|
||||||
//% whenUsed block="remote button top-left" weight=95 fixedInstance
|
//% whenUsed block="top-left" weight=95 fixedInstance
|
||||||
export const remoteButtonTopLeft = irButton(IrRemoteButton.TopLeft)
|
export const remoteButtonTopLeft = irButton(IrRemoteButton.TopLeft)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remote top-right button.
|
* Remote top-right button.
|
||||||
*/
|
*/
|
||||||
//% whenUsed block="remote button top-right" weight=95 fixedInstance
|
//% whenUsed block="top-right" weight=95 fixedInstance
|
||||||
export const remoteButtonTopRight = irButton(IrRemoteButton.TopRight)
|
export const remoteButtonTopRight = irButton(IrRemoteButton.TopRight)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remote bottom-left button.
|
* Remote bottom-left button.
|
||||||
*/
|
*/
|
||||||
//% whenUsed block="remote button bottom-left" weight=95 fixedInstance
|
//% whenUsed block="bottom-left" weight=95 fixedInstance
|
||||||
export const remoteButtonBottomLeft = irButton(IrRemoteButton.BottomLeft)
|
export const remoteButtonBottomLeft = irButton(IrRemoteButton.BottomLeft)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remote bottom-right button.
|
* Remote bottom-right button.
|
||||||
*/
|
*/
|
||||||
//% whenUsed block="remote button bottom-right" weight=95 fixedInstance
|
//% whenUsed block="bottom-right" weight=95 fixedInstance
|
||||||
export const remoteButtonBottomRight = irButton(IrRemoteButton.BottomRight)
|
export const remoteButtonBottomRight = irButton(IrRemoteButton.BottomRight)
|
||||||
}
|
}
|
||||||
|
BIN
libs/core/jres/icons/brickButtons-icon.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
libs/core/jres/icons/brickDisplay-icon.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
libs/core/jres/icons/colorSensor-icon.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
libs/core/jres/icons/gyroSensor-icon.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
libs/core/jres/icons/infraredSensor-icon.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
libs/core/jres/icons/motorLarge-icon.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
libs/core/jres/icons/motorMedium-icon.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
libs/core/jres/icons/touchSensor-icon.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
libs/core/jres/icons/ultrasonicSensor-icon.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
@ -66,7 +66,7 @@ namespace motors {
|
|||||||
/**
|
/**
|
||||||
* Stops all motors
|
* Stops all motors
|
||||||
*/
|
*/
|
||||||
//% blockId=motorStopAll block="stop all motors"
|
//% blockId=motorStopAll block="stop all `icons.motorLarge`"
|
||||||
//% weight=10 group="Motors" blockGap=8
|
//% weight=10 group="Motors" blockGap=8
|
||||||
export function stopAllMotors() {
|
export function stopAllMotors() {
|
||||||
const b = mkCmd(Output.ALL, DAL.opOutputStop, 0)
|
const b = mkCmd(Output.ALL, DAL.opOutputStop, 0)
|
||||||
@ -91,7 +91,7 @@ namespace motors {
|
|||||||
* @param motor the output connection that the motor is connected to
|
* @param motor the output connection that the motor is connected to
|
||||||
* @param power the power from ``100`` full forward to ``-100`` full backward, eg: 50
|
* @param power the power from ``100`` full forward to ``-100`` full backward, eg: 50
|
||||||
*/
|
*/
|
||||||
//% blockId=motorSetPower block="power %motor|to %power|%"
|
//% blockId=motorSetPower block="power `icons.motorLarge` %motor|to %power|%"
|
||||||
//% weight=99 group="Motors" blockGap=8
|
//% weight=99 group="Motors" blockGap=8
|
||||||
//% power.min=-100 power.max=100
|
//% power.min=-100 power.max=100
|
||||||
power(power: number) {
|
power(power: number) {
|
||||||
@ -114,7 +114,7 @@ namespace motors {
|
|||||||
* @param angle the degrees to rotate, eg: 360
|
* @param angle the degrees to rotate, eg: 360
|
||||||
* @param power the power from ``100`` full forward to ``-100`` full backward, eg: 50
|
* @param power the power from ``100`` full forward to ``-100`` full backward, eg: 50
|
||||||
*/
|
*/
|
||||||
//% blockId=motorMove block="move %motor|by %angle|degrees at %power|%"
|
//% blockId=motorMove block="move `icons.motorLarge` %motor|by %angle|degrees at %power|%"
|
||||||
//% weight=98 group="Motors" blockGap=8
|
//% weight=98 group="Motors" blockGap=8
|
||||||
//% power.min=-100 power.max=100
|
//% power.min=-100 power.max=100
|
||||||
move(angle: number, power: number) {
|
move(angle: number, power: number) {
|
||||||
@ -134,7 +134,7 @@ namespace motors {
|
|||||||
/**
|
/**
|
||||||
* Stops the motor
|
* Stops the motor
|
||||||
*/
|
*/
|
||||||
//% blockId=motorStop block="stop %motor"
|
//% blockId=motorStop block="stop `icons.motorLarge` %motor"
|
||||||
//% weight=97 group="Motors"
|
//% weight=97 group="Motors"
|
||||||
stop() {
|
stop() {
|
||||||
const b = mkCmd(this.port, DAL.opOutputStop, 1)
|
const b = mkCmd(this.port, DAL.opOutputStop, 1)
|
||||||
@ -146,7 +146,7 @@ namespace motors {
|
|||||||
* Sets the automatic brake on or off when the motor is off
|
* Sets the automatic brake on or off when the motor is off
|
||||||
* @param brake a value indicating if the motor should break when off
|
* @param brake a value indicating if the motor should break when off
|
||||||
*/
|
*/
|
||||||
//% blockId=outputMotorSetBrakeMode block="set %motor|brake %brake"
|
//% blockId=outputMotorSetBrakeMode block="set `icons.motorLarge` %motor|brake %brake"
|
||||||
//% brake.fieldEditor=toggleonoff
|
//% brake.fieldEditor=toggleonoff
|
||||||
//% weight=60 group="Motors" blockGap=8
|
//% weight=60 group="Motors" blockGap=8
|
||||||
setBrake(brake: boolean) {
|
setBrake(brake: boolean) {
|
||||||
@ -156,7 +156,7 @@ namespace motors {
|
|||||||
/**
|
/**
|
||||||
* Reverses the motor polarity
|
* Reverses the motor polarity
|
||||||
*/
|
*/
|
||||||
//% blockId=motorSetReversed block="set %motor|reversed %reversed"
|
//% blockId=motorSetReversed block="set `icons.motorLarge` %motor|reversed %reversed"
|
||||||
//% reversed.fieldEditor=toggleonoff
|
//% reversed.fieldEditor=toggleonoff
|
||||||
//% weight=59 group="Motors"
|
//% weight=59 group="Motors"
|
||||||
setReversed(reversed: boolean) {
|
setReversed(reversed: boolean) {
|
||||||
@ -169,7 +169,7 @@ namespace motors {
|
|||||||
* Gets motor actual speed.
|
* Gets motor actual speed.
|
||||||
* @param motor the port which connects to the motor
|
* @param motor the port which connects to the motor
|
||||||
*/
|
*/
|
||||||
//% blockId=motorSpeed block="%motor|speed"
|
//% blockId=motorSpeed block="`icons.motorLarge` %motor|speed"
|
||||||
//% weight=72 group="Motors" blockGap=8
|
//% weight=72 group="Motors" blockGap=8
|
||||||
speed(): number {
|
speed(): number {
|
||||||
return getMotorData(this.port).actualSpeed;
|
return getMotorData(this.port).actualSpeed;
|
||||||
@ -179,7 +179,7 @@ namespace motors {
|
|||||||
* Gets motor step count.
|
* Gets motor step count.
|
||||||
* @param motor the port which connects to the motor
|
* @param motor the port which connects to the motor
|
||||||
*/
|
*/
|
||||||
//% blockId=motorCount block="%motor|count"
|
//% blockId=motorCount block="`icons.motorLarge` %motor|count"
|
||||||
//% weight=71 group="Motors" blockGap=8
|
//% weight=71 group="Motors" blockGap=8
|
||||||
count(): number {
|
count(): number {
|
||||||
return getMotorData(this.port).count;
|
return getMotorData(this.port).count;
|
||||||
@ -189,7 +189,7 @@ namespace motors {
|
|||||||
* Gets motor tacho count.
|
* Gets motor tacho count.
|
||||||
* @param motor the port which connects to the motor
|
* @param motor the port which connects to the motor
|
||||||
*/
|
*/
|
||||||
//% blockId=motorTachoCount block="%motor|tacho count"
|
//% blockId=motorTachoCount block="`icons.motorLarge` %motor|tacho count"
|
||||||
//% weight=70 group="Motors"
|
//% weight=70 group="Motors"
|
||||||
tachoCount(): number {
|
tachoCount(): number {
|
||||||
return getMotorData(this.port).tachoCount;
|
return getMotorData(this.port).tachoCount;
|
||||||
@ -216,28 +216,28 @@ namespace motors {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//% whenUsed fixedInstance block="large motor A"
|
//% whenUsed fixedInstance block="large A"
|
||||||
export const largeMotorA = new Motor(Output.A, true);
|
export const largeMotorA = new Motor(Output.A, true);
|
||||||
|
|
||||||
//% whenUsed fixedInstance block="large motor B"
|
//% whenUsed fixedInstance block="large B"
|
||||||
export const largeMotorB = new Motor(Output.B, true);
|
export const largeMotorB = new Motor(Output.B, true);
|
||||||
|
|
||||||
//% whenUsed fixedInstance block="large motor C"
|
//% whenUsed fixedInstance block="large C"
|
||||||
export const largeMotorC = new Motor(Output.C, true);
|
export const largeMotorC = new Motor(Output.C, true);
|
||||||
|
|
||||||
//% whenUsed fixedInstance block="large motor D"
|
//% whenUsed fixedInstance block="large D"
|
||||||
export const largeMotorD = new Motor(Output.D, true);
|
export const largeMotorD = new Motor(Output.D, true);
|
||||||
|
|
||||||
//% whenUsed fixedInstance block="medium motor A"
|
//% whenUsed fixedInstance block="medium A"
|
||||||
export const mediumMotorA = new Motor(Output.A, false);
|
export const mediumMotorA = new Motor(Output.A, false);
|
||||||
|
|
||||||
//% whenUsed fixedInstance block="medium motor B"
|
//% whenUsed fixedInstance block="medium B"
|
||||||
export const mediumMotorB = new Motor(Output.B, false);
|
export const mediumMotorB = new Motor(Output.B, false);
|
||||||
|
|
||||||
//% whenUsed fixedInstance block="medium motor C"
|
//% whenUsed fixedInstance block="medium C"
|
||||||
export const mediumMotorC = new Motor(Output.C, false);
|
export const mediumMotorC = new Motor(Output.C, false);
|
||||||
|
|
||||||
//% whenUsed fixedInstance block="medium motor D"
|
//% whenUsed fixedInstance block="medium D"
|
||||||
export const mediumMotorD = new Motor(Output.D, false);
|
export const mediumMotorD = new Motor(Output.D, false);
|
||||||
|
|
||||||
function reset(out: Output) {
|
function reset(out: Output) {
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
"dal.d.ts",
|
"dal.d.ts",
|
||||||
"images.ts",
|
"images.ts",
|
||||||
"images.jres",
|
"images.jres",
|
||||||
|
"icons.jres",
|
||||||
"ns.ts"
|
"ns.ts"
|
||||||
],
|
],
|
||||||
"testFiles": [
|
"testFiles": [
|
||||||
|
@ -84,7 +84,7 @@ namespace brick {
|
|||||||
* @param x the starting position's x coordinate, eg: 0
|
* @param x the starting position's x coordinate, eg: 0
|
||||||
* @param y the starting position's x coordinate, eg: 0
|
* @param y the starting position's x coordinate, eg: 0
|
||||||
*/
|
*/
|
||||||
//% blockId=screen_setpixel block="set pixel %on| at x: %x| y: %y"
|
//% blockId=screen_setpixel block="`icons.brickDisplay` set pixel %on| at x: %x| y: %y"
|
||||||
//% weight=98 group="Screen"
|
//% weight=98 group="Screen"
|
||||||
//% x.min=0 x.max=178 y.min=0 y.max=128 on.fieldEditor=toggleonoff
|
//% x.min=0 x.max=178 y.min=0 y.max=128 on.fieldEditor=toggleonoff
|
||||||
export function setPixel(on: boolean, x: number, y: number) {
|
export function setPixel(on: boolean, x: number, y: number) {
|
||||||
@ -100,7 +100,7 @@ namespace brick {
|
|||||||
* @param x the starting position's x coordinate, eg: 0
|
* @param x the starting position's x coordinate, eg: 0
|
||||||
* @param y the starting position's x coordinate, eg: 0
|
* @param y the starting position's x coordinate, eg: 0
|
||||||
*/
|
*/
|
||||||
//% blockId=screen_print block="print %text| at x: %x| y: %y"
|
//% blockId=screen_print block="`icons.brickDisplay` print %text| at x: %x| y: %y"
|
||||||
//% weight=99 group="Screen" inlineInputMode="inline" blockGap=8
|
//% weight=99 group="Screen" inlineInputMode="inline" blockGap=8
|
||||||
//% x.min=0 x.max=178 y.min=0 y.max=128
|
//% x.min=0 x.max=178 y.min=0 y.max=128
|
||||||
export function print(text: string, x: number, y: number, mode = Draw.Normal) {
|
export function print(text: string, x: number, y: number, mode = Draw.Normal) {
|
||||||
|
@ -35,12 +35,28 @@ namespace sensors {
|
|||||||
return DAL.DEVICE_TYPE_TOUCH
|
return DAL.DEVICE_TYPE_TOUCH
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do something when a touch sensor is touched...
|
||||||
|
* @param sensor the touch sensor that needs to be clicked or used
|
||||||
|
* @param event the kind of button gesture that needs to be detected
|
||||||
|
* @param body code to run when the event is raised
|
||||||
|
*/
|
||||||
|
//% help=input/touch/on-event
|
||||||
|
//% blockId=touchEvent block="on `icons.touchSensor` %sensor|%event"
|
||||||
|
//% parts="touch"
|
||||||
|
//% blockNamespace=sensors
|
||||||
|
//% weight=99 blockGap=8
|
||||||
|
//% group="Touch Sensor"
|
||||||
|
onEvent(ev: TouchSensorEvent, body: () => void) {
|
||||||
|
this.button.onEvent(<ButtonEvent><number>ev, body)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if touch sensor is touched.
|
* Check if touch sensor is touched.
|
||||||
* @param sensor the port to query the request
|
* @param sensor the port to query the request
|
||||||
*/
|
*/
|
||||||
//% help=input/touch/is-touched
|
//% help=input/touch/is-touched
|
||||||
//% block="%sensor|is touched"
|
//% block="`icons.touchSensor` %sensor|is touched"
|
||||||
//% blockId=touchIsTouched
|
//% blockId=touchIsTouched
|
||||||
//% parts="touch"
|
//% parts="touch"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
@ -49,30 +65,14 @@ namespace sensors {
|
|||||||
isTouched() {
|
isTouched() {
|
||||||
return this.button.isPressed();
|
return this.button.isPressed();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Do something when a touch sensor is touched...
|
|
||||||
* @param sensor the touch sensor that needs to be clicked or used
|
|
||||||
* @param event the kind of button gesture that needs to be detected
|
|
||||||
* @param body code to run when the event is raised
|
|
||||||
*/
|
|
||||||
//% help=input/touch/on-event
|
|
||||||
//% blockId=touchEvent block="on %sensor|%event"
|
|
||||||
//% parts="touch"
|
|
||||||
//% blockNamespace=sensors
|
|
||||||
//% weight=99 blockGap=8
|
|
||||||
//% group="Touch Sensor"
|
|
||||||
onEvent(ev: TouchSensorEvent, body: () => void) {
|
|
||||||
this.button.onEvent(<ButtonEvent><number>ev, body)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//% whenUsed block="touch sensor 1" weight=95 fixedInstance
|
//% whenUsed block="1" weight=95 fixedInstance
|
||||||
export const touchSensor1: TouchSensor = new TouchSensor(1)
|
export const touchSensor1: TouchSensor = new TouchSensor(1)
|
||||||
//% whenUsed block="touch sensor 2" weight=95 fixedInstance
|
//% whenUsed block="2" weight=95 fixedInstance
|
||||||
export const touchSensor2: TouchSensor = new TouchSensor(2)
|
export const touchSensor2: TouchSensor = new TouchSensor(2)
|
||||||
//% whenUsed block="touch sensor 3" weight=95 fixedInstance
|
//% whenUsed block="3" weight=95 fixedInstance
|
||||||
export const touchSensor3: TouchSensor = new TouchSensor(3)
|
export const touchSensor3: TouchSensor = new TouchSensor(3)
|
||||||
//% whenUsed block="touch sensor 4" weight=95 fixedInstance
|
//% whenUsed block="4" weight=95 fixedInstance
|
||||||
export const touchSensor4: TouchSensor = new TouchSensor(4)
|
export const touchSensor4: TouchSensor = new TouchSensor(4)
|
||||||
}
|
}
|
||||||
|
@ -41,9 +41,9 @@ namespace sensors {
|
|||||||
* @param handler the code to run when detected
|
* @param handler the code to run when detected
|
||||||
*/
|
*/
|
||||||
//% help=input/ultrasonic/on
|
//% help=input/ultrasonic/on
|
||||||
//% block="on %sensor|%event"
|
|
||||||
//% blockId=ultrasonicOn
|
//% blockId=ultrasonicOn
|
||||||
//% parts="infraredsensor"
|
//% block="on `icons.ultrasonicSensor` %sensor|%event"
|
||||||
|
//% parts="ultrasonicsensor"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
//% weight=100 blockGap=8
|
//% weight=100 blockGap=8
|
||||||
//% group="Ultrasonic Sensor"
|
//% group="Ultrasonic Sensor"
|
||||||
@ -58,9 +58,9 @@ namespace sensors {
|
|||||||
* Waits for the event to occur
|
* Waits for the event to occur
|
||||||
*/
|
*/
|
||||||
//% help=input/ultrasonic/wait
|
//% help=input/ultrasonic/wait
|
||||||
//% block="wait %sensor|for %event"
|
//% block="wait `icons.ultrasonicSensor` %sensor|for %event"
|
||||||
//% blockId=ultrasonicWait
|
//% blockId=ultrasonicWait
|
||||||
//% parts="infraredsensor"
|
//% parts="ultrasonicsensor"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
//% weight=99 blockGap=8
|
//% weight=99 blockGap=8
|
||||||
//% group="Ultrasonic Sensor"
|
//% group="Ultrasonic Sensor"
|
||||||
@ -73,9 +73,9 @@ namespace sensors {
|
|||||||
* @param sensor the ultrasonic sensor port
|
* @param sensor the ultrasonic sensor port
|
||||||
*/
|
*/
|
||||||
//% help=input/ultrasonic/distance
|
//% help=input/ultrasonic/distance
|
||||||
//% block="%sensor|distance"
|
//% block="`icons.ultrasonicSensor` %sensor|distance"
|
||||||
//% blockId=sonarGetDistance
|
//% blockId=sonarGetDistance
|
||||||
//% parts="ultrasonic"
|
//% parts="ultrasonicsensor"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
//% weight=65 blockGap=8
|
//% weight=65 blockGap=8
|
||||||
//% group="Ultrasonic Sensor"
|
//% group="Ultrasonic Sensor"
|
||||||
@ -85,16 +85,16 @@ namespace sensors {
|
|||||||
return this.getNumber(NumberFormat.UInt16LE, 0) & 0x0fff;
|
return this.getNumber(NumberFormat.UInt16LE, 0) & 0x0fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="ultrasonic sensor 4"
|
|
||||||
export const ultrasonic4: UltraSonicSensor = new UltraSonicSensor(4)
|
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="ultrasonic sensor 1"
|
//% fixedInstance whenUsed block="1"
|
||||||
export const ultrasonic1: UltraSonicSensor = new UltraSonicSensor(1)
|
export const ultrasonic1: UltraSonicSensor = new UltraSonicSensor(1)
|
||||||
|
|
||||||
|
//% fixedInstance whenUsed block="4"
|
||||||
|
export const ultrasonic4: UltraSonicSensor = new UltraSonicSensor(4)
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="ultrasonic sensor 2"
|
//% fixedInstance whenUsed block="2"
|
||||||
export const ultrasonic2: UltraSonicSensor = new UltraSonicSensor(2)
|
export const ultrasonic2: UltraSonicSensor = new UltraSonicSensor(2)
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="ultrasonic sensor 3"
|
//% fixedInstance whenUsed block="3"
|
||||||
export const ultrasonic3: UltraSonicSensor = new UltraSonicSensor(3)
|
export const ultrasonic3: UltraSonicSensor = new UltraSonicSensor(3)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "pxt-ev3",
|
"name": "pxt-ev3",
|
||||||
"version": "0.0.29",
|
"version": "0.0.30",
|
||||||
"description": "LEGO Mindstorms EV3 for Microsoft MakeCode",
|
"description": "LEGO Mindstorms EV3 for Microsoft MakeCode",
|
||||||
"private": true,
|
"private": true,
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@ -39,8 +39,8 @@
|
|||||||
"semantic-ui-less": "^2.2.4"
|
"semantic-ui-less": "^2.2.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pxt-common-packages": "0.12.17",
|
"pxt-common-packages": "0.14.2",
|
||||||
"pxt-core": "2.3.19"
|
"pxt-core": "2.3.27"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node node_modules/pxt-core/built/pxt.js travis"
|
"test": "node node_modules/pxt-core/built/pxt.js travis"
|
||||||
|