Compare commits
23 Commits
Author | SHA1 | Date | |
---|---|---|---|
79fcd1c01e | |||
2d48725c63 | |||
802c3db0ba | |||
4a7e8c5fa8 | |||
0ebffd8549 | |||
988a2b638b | |||
fb743dea74 | |||
e400637ba1 | |||
b2768b1099 | |||
3a5885b28e | |||
b602b52f7d | |||
90afb60cc4 | |||
c936c16c33 | |||
d100026d5c | |||
41c2899feb | |||
9437873427 | |||
dab281a9cb | |||
f27fb4d93c | |||
11fb82eba9 | |||
170e6b700b | |||
387ad763f8 | |||
0e61f162bb | |||
400f01a6be |
@ -151,6 +151,6 @@
|
||||
"serial.writeNumber": "Write a number to the serial port.",
|
||||
"serial.writeString": "Write some text to the serial port.",
|
||||
"serial.writeValue": "Write a name:value pair as a line of text to the serial port.",
|
||||
"serial.writeValue|param|name": "name of the value stream, eg: x",
|
||||
"serial.writeValue|param|name": "name of the value stream, eg: \"x\"",
|
||||
"serial.writeValue|param|value": "to write"
|
||||
}
|
@ -30,7 +30,7 @@
|
||||
"control.waitMicros|block": "wait (µs)%micros",
|
||||
"control|block": "control",
|
||||
"loops.forever|block": "forever",
|
||||
"loops.pause|block": "pause %ms=timePicker|ms",
|
||||
"loops.pause|block": "pause %pause=timePicker|ms",
|
||||
"loops.timePicker|block": "%ms",
|
||||
"loops|block": "loops",
|
||||
"parseInt|block": "parse to integer %text",
|
||||
|
10
libs/base/shims.d.ts
vendored
@ -79,7 +79,7 @@ declare namespace loops {
|
||||
* @param ms how long to pause for, eg: 100, 200, 500, 1000, 2000
|
||||
*/
|
||||
//% help=loops/pause weight=99
|
||||
//% async block="pause %ms=timePicker|ms"
|
||||
//% async block="pause %pause=timePicker|ms"
|
||||
//% blockId=device_pause shim=loops::pause
|
||||
function pause(ms: int32): void;
|
||||
}
|
||||
@ -99,8 +99,8 @@ declare namespace control {
|
||||
*/
|
||||
//% weight=20 blockGap=8 blockId="control_on_event" block="on event|from %src|with value %value"
|
||||
//% blockExternalInputs=1
|
||||
//% help="control/on-event" shim=control::onEvent
|
||||
function onEvent(src: int32, value: int32, handler: () => void): void;
|
||||
//% help="control/on-event" flags.defl=16 shim=control::onEvent
|
||||
function onEvent(src: int32, value: int32, handler: () => void, flags?: int32): void;
|
||||
|
||||
/**
|
||||
* Reset the device.
|
||||
@ -144,14 +144,14 @@ declare namespace serial {
|
||||
* Write some text to the serial port.
|
||||
*/
|
||||
//% help=serial/write-string
|
||||
//% weight=87
|
||||
//% weight=87 blockHidden=true
|
||||
//% blockId=serial_writestring block="serial|write string %text" shim=serial::writeString
|
||||
function writeString(text: string): void;
|
||||
|
||||
/**
|
||||
* Send a buffer across the serial connection.
|
||||
*/
|
||||
//% help=serial/write-buffer weight=6
|
||||
//% help=serial/write-buffer weight=6 blockHidden=true
|
||||
//% blockId=serial_writebuffer block="serial|write buffer %buffer" shim=serial::writeBuffer
|
||||
function writeBuffer(buffer: Buffer): void;
|
||||
}
|
||||
|
@ -20,6 +20,8 @@
|
||||
"brick.Button.onEvent": "Do something when a button or sensor is clicked, up or down.",
|
||||
"brick.Button.onEvent|param|body": "code to run when the event is raised",
|
||||
"brick.Button.wasPressed": "See if the button was pressed again since the last time you checked.",
|
||||
"brick._imagePicker": "An image",
|
||||
"brick._imagePicker|param|image": "the image",
|
||||
"brick.buttonDown": "Down button on the EV3 Brick.",
|
||||
"brick.buttonEnter": "Enter button on the EV3 Brick.",
|
||||
"brick.buttonLeft": "Left button on the EV3 Brick.",
|
||||
@ -37,6 +39,8 @@
|
||||
"brick.setPixel|param|y": "the starting position's x coordinate, eg: 0",
|
||||
"brick.setStatusLight": "Set lights.",
|
||||
"brick.setStatusLight|param|pattern": "the lights pattern to use.",
|
||||
"brick.showImage": "Shows an image on screen",
|
||||
"brick.showImage|param|image": "image to draw",
|
||||
"control": "Program controls and events.",
|
||||
"control.allocateNotifyEvent": "Allocates the next user notification event",
|
||||
"control.deviceFirmwareVersion": "Determine the version of system software currently running.",
|
||||
|
@ -32,84 +32,86 @@
|
||||
"TouchSensorEvent.Released|block": "released",
|
||||
"UltrasonicSensorEvent.ObjectDetected|block": "object detected",
|
||||
"UltrasonicSensorEvent.ObjectNear|block": "object near",
|
||||
"brick.Button.isPressed|block": "%button|is pressed",
|
||||
"brick.Button.onEvent|block": "on %button|%event",
|
||||
"brick.Button.wasPressed|block": "%button|was pressed",
|
||||
"brick.buttonDown|block": "button down",
|
||||
"brick.buttonEnter|block": "button enter",
|
||||
"brick.buttonLeft|block": "button left",
|
||||
"brick.buttonRight|block": "button right",
|
||||
"brick.buttonUp|block": "button up",
|
||||
"brick.Button.isPressed|block": "`icons.brickButtons` %button|is pressed",
|
||||
"brick.Button.onEvent|block": "on `icons.brickButtons` %button|%event",
|
||||
"brick.Button.wasPressed|block": "`icons.brickButtons` %button|was pressed",
|
||||
"brick._imagePicker|block": "%image",
|
||||
"brick.buttonDown|block": "down",
|
||||
"brick.buttonEnter|block": "enter",
|
||||
"brick.buttonLeft|block": "left",
|
||||
"brick.buttonRight|block": "right",
|
||||
"brick.buttonUp|block": "up",
|
||||
"brick.pattern|block": "%pattern",
|
||||
"brick.print|block": "print %text| at x: %x| y: %y",
|
||||
"brick.setPixel|block": "set pixel %on| at x: %x| y: %y",
|
||||
"brick.setStatusLight|block": "set status light %pattern=led_pattern",
|
||||
"brick.print|block": "`icons.brickDisplay` print %text| at x: %x| y: %y",
|
||||
"brick.setPixel|block": "`icons.brickDisplay` set pixel %on| at x: %x| y: %y",
|
||||
"brick.setStatusLight|block": "set `icons.brickButtons` to %pattern=led_pattern",
|
||||
"brick.showImage|block": "`icons.brickDisplay` show image %image=scren_image_picker",
|
||||
"brick|block": "brick",
|
||||
"control.raiseEvent|block": "raise event|from %src|with value %value",
|
||||
"control|block": "control",
|
||||
"motors.Motor.count|block": "%motor|count",
|
||||
"motors.Motor.move|block": "move %motor|by %angle|degrees at %power|%",
|
||||
"motors.Motor.power|block": "power %motor|to %power|%",
|
||||
"motors.Motor.setBrake|block": "set %motor|brake %brake",
|
||||
"motors.Motor.setReversed|block": "set %motor|reversed %reversed",
|
||||
"motors.Motor.speed|block": "%motor|speed",
|
||||
"motors.Motor.stop|block": "stop %motor",
|
||||
"motors.Motor.tachoCount|block": "%motor|tacho count",
|
||||
"motors.largeMotorA|block": "large motor A",
|
||||
"motors.largeMotorB|block": "large motor B",
|
||||
"motors.largeMotorC|block": "large motor C",
|
||||
"motors.largeMotorD|block": "large motor D",
|
||||
"motors.mediumMotorA|block": "medium motor A",
|
||||
"motors.mediumMotorB|block": "medium motor B",
|
||||
"motors.mediumMotorC|block": "medium motor C",
|
||||
"motors.mediumMotorD|block": "medium motor D",
|
||||
"motors.stopAllMotors|block": "stop all motors",
|
||||
"motors.Motor.count|block": "`icons.motorLarge` %motor|count",
|
||||
"motors.Motor.move|block": "move `icons.motorLarge` %motor|by %angle|degrees at %power|%",
|
||||
"motors.Motor.power|block": "power `icons.motorLarge` %motor|to %power|%",
|
||||
"motors.Motor.setBrake|block": "set `icons.motorLarge` %motor|brake %brake",
|
||||
"motors.Motor.setReversed|block": "set `icons.motorLarge` %motor|reversed %reversed",
|
||||
"motors.Motor.speed|block": "`icons.motorLarge` %motor|speed",
|
||||
"motors.Motor.stop|block": "stop `icons.motorLarge` %motor",
|
||||
"motors.Motor.tachoCount|block": "`icons.motorLarge` %motor|tacho count",
|
||||
"motors.largeMotorA|block": "large A",
|
||||
"motors.largeMotorB|block": "large B",
|
||||
"motors.largeMotorC|block": "large C",
|
||||
"motors.largeMotorD|block": "large D",
|
||||
"motors.mediumMotorA|block": "medium A",
|
||||
"motors.mediumMotorB|block": "medium B",
|
||||
"motors.mediumMotorC|block": "medium C",
|
||||
"motors.mediumMotorD|block": "medium D",
|
||||
"motors.stopAllMotors|block": "stop all `icons.motorLarge`",
|
||||
"motors|block": "motors",
|
||||
"output|block": "output",
|
||||
"screen|block": "screen",
|
||||
"sensors.ColorSensor.ambientLight|block": "%color| ambient light",
|
||||
"sensors.ColorSensor.color|block": "%color| color",
|
||||
"sensors.ColorSensor.onColorDetected|block": "on %sensor|detected %color",
|
||||
"sensors.ColorSensor.reflectedLight|block": "%color| reflected light",
|
||||
"sensors.GyroSensor.angle|block": "%sensor|angle",
|
||||
"sensors.GyroSensor.rate|block": "%sensor|rotation rate",
|
||||
"sensors.InfraredSensor.on|block": "on %sensor|%event",
|
||||
"sensors.InfraredSensor.proximity|block": "%infrared|proximity",
|
||||
"sensors.InfraredSensor.remoteCommand|block": "%infrared|remote command",
|
||||
"sensors.InfraredSensor.wait|block": "wait %sensor|for %event",
|
||||
"sensors.RemoteInfraredBeaconButton.isPressed|block": "%button|is pressed",
|
||||
"sensors.RemoteInfraredBeaconButton.onEvent|block": "on %button|%event",
|
||||
"sensors.RemoteInfraredBeaconButton.wasPressed|block": "%button|was pressed",
|
||||
"sensors.TouchSensor.isTouched|block": "%sensor|is touched",
|
||||
"sensors.TouchSensor.onEvent|block": "on %sensor|%event",
|
||||
"sensors.UltraSonicSensor.distance|block": "%sensor|distance",
|
||||
"sensors.UltraSonicSensor.on|block": "on %sensor|%event",
|
||||
"sensors.UltraSonicSensor.wait|block": "wait %sensor|for %event",
|
||||
"sensors.color1|block": "color sensor 1",
|
||||
"sensors.color2|block": "color sensor 2",
|
||||
"sensors.color3|block": "color sensor 3",
|
||||
"sensors.color4|block": "color sensor 4",
|
||||
"sensors.gyro1|block": "gyro sensor 1",
|
||||
"sensors.gyro2|block": "gyro sensor 2",
|
||||
"sensors.gyro3|block": "gyro sensor 3",
|
||||
"sensors.gyro4|block": "gyro sensor 4",
|
||||
"sensors.infraredSensor1|block": "infrared sensor 1",
|
||||
"sensors.infraredSensor2|block": "infrared sensor 2",
|
||||
"sensors.infraredSensor3|block": "infrared sensor 3",
|
||||
"sensors.infraredSensor4|block": "infrared sensor 4",
|
||||
"sensors.remoteButtonBottomLeft|block": "remote button bottom-left",
|
||||
"sensors.remoteButtonBottomRight|block": "remote button bottom-right",
|
||||
"sensors.remoteButtonCenter|block": "remote button center",
|
||||
"sensors.remoteButtonTopLeft|block": "remote button top-left",
|
||||
"sensors.remoteButtonTopRight|block": "remote button top-right",
|
||||
"sensors.touchSensor1|block": "touch sensor 1",
|
||||
"sensors.touchSensor2|block": "touch sensor 2",
|
||||
"sensors.touchSensor3|block": "touch sensor 3",
|
||||
"sensors.touchSensor4|block": "touch sensor 4",
|
||||
"sensors.ultrasonic1|block": "ultrasonic sensor 1",
|
||||
"sensors.ultrasonic2|block": "ultrasonic sensor 2",
|
||||
"sensors.ultrasonic3|block": "ultrasonic sensor 3",
|
||||
"sensors.ultrasonic4|block": "ultrasonic sensor 4",
|
||||
"sensors.ColorSensor.ambientLight|block": "`icons.colorSensor` %color| ambient light",
|
||||
"sensors.ColorSensor.color|block": "`icons.colorSensor` %color| color",
|
||||
"sensors.ColorSensor.onColorDetected|block": "on `icons.colorSensor` %sensor|detected %color",
|
||||
"sensors.ColorSensor.reflectedLight|block": "`icons.colorSensor` %color| reflected light",
|
||||
"sensors.GyroSensor.angle|block": "`icons.gyroSensor` %sensor|angle",
|
||||
"sensors.GyroSensor.rate|block": "`icons.gyroSensor` %sensor|rotation rate",
|
||||
"sensors.InfraredSensor.on|block": "on `icons.infraredSensor` %sensor|%event",
|
||||
"sensors.InfraredSensor.proximity|block": "`icons.infraredSensor` %infrared|proximity",
|
||||
"sensors.InfraredSensor.remoteCommand|block": "`icons.infraredSensor` %infrared|remote command",
|
||||
"sensors.InfraredSensor.wait|block": "wait `icons.infraredSensor` %sensor|for %event",
|
||||
"sensors.RemoteInfraredBeaconButton.isPressed|block": "`icons.infraredSensor` %button|is pressed",
|
||||
"sensors.RemoteInfraredBeaconButton.onEvent|block": "on `icons.infraredSensor` %button|%event",
|
||||
"sensors.RemoteInfraredBeaconButton.wasPressed|block": "`icons.infraredSensor` %button|was pressed",
|
||||
"sensors.TouchSensor.isTouched|block": "`icons.touchSensor` %sensor|is touched",
|
||||
"sensors.TouchSensor.onEvent|block": "on `icons.touchSensor` %sensor|%event",
|
||||
"sensors.UltraSonicSensor.distance|block": "`icons.ultrasonicSensor` %sensor|distance",
|
||||
"sensors.UltraSonicSensor.on|block": "on `icons.ultrasonicSensor` %sensor|%event",
|
||||
"sensors.UltraSonicSensor.wait|block": "wait `icons.ultrasonicSensor` %sensor|for %event",
|
||||
"sensors.color1|block": "1",
|
||||
"sensors.color2|block": "2",
|
||||
"sensors.color3|block": "3",
|
||||
"sensors.color4|block": "4",
|
||||
"sensors.gyro1|block": "1",
|
||||
"sensors.gyro2|block": "2",
|
||||
"sensors.gyro3|block": "3",
|
||||
"sensors.gyro4|block": "4",
|
||||
"sensors.infraredSensor1|block": "1",
|
||||
"sensors.infraredSensor2|block": "2",
|
||||
"sensors.infraredSensor3|block": "3",
|
||||
"sensors.infraredSensor4|block": "4",
|
||||
"sensors.remoteButtonBottomLeft|block": "bottom-left",
|
||||
"sensors.remoteButtonBottomRight|block": "bottom-right",
|
||||
"sensors.remoteButtonCenter|block": "center",
|
||||
"sensors.remoteButtonTopLeft|block": "top-left",
|
||||
"sensors.remoteButtonTopRight|block": "top-right",
|
||||
"sensors.touchSensor1|block": "1",
|
||||
"sensors.touchSensor2|block": "2",
|
||||
"sensors.touchSensor3|block": "3",
|
||||
"sensors.touchSensor4|block": "4",
|
||||
"sensors.ultrasonic1|block": "1",
|
||||
"sensors.ultrasonic2|block": "2",
|
||||
"sensors.ultrasonic3|block": "3",
|
||||
"sensors.ultrasonic4|block": "4",
|
||||
"sensors|block": "sensors",
|
||||
"serial|block": "serial",
|
||||
"{id:category}Brick": "Brick",
|
||||
|
@ -84,7 +84,7 @@ namespace brick {
|
||||
* @param button the button to query the request
|
||||
*/
|
||||
//% help=input/button/is-pressed
|
||||
//% block="%button|is pressed"
|
||||
//% block="`icons.brickButtons` %button|is pressed"
|
||||
//% blockId=buttonIsPressed
|
||||
//% parts="brick"
|
||||
//% blockNamespace=brick
|
||||
@ -99,7 +99,7 @@ namespace brick {
|
||||
* @param button the button to query the request
|
||||
*/
|
||||
//% help=input/button/was-pressed
|
||||
//% block="%button|was pressed"
|
||||
//% block="`icons.brickButtons` %button|was pressed"
|
||||
//% blockId=buttonWasPressed
|
||||
//% parts="brick"
|
||||
//% blockNamespace=brick
|
||||
@ -118,7 +118,7 @@ namespace brick {
|
||||
* @param body code to run when the event is raised
|
||||
*/
|
||||
//% help=input/button/on-event
|
||||
//% blockId=buttonEvent block="on %button|%event"
|
||||
//% blockId=buttonEvent block="on `icons.brickButtons` %button|%event"
|
||||
//% parts="brick"
|
||||
//% blockNamespace=brick
|
||||
//% weight=99 blockGap=8
|
||||
@ -180,31 +180,31 @@ namespace 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)
|
||||
|
||||
/**
|
||||
* 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)
|
||||
|
||||
/**
|
||||
* 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)
|
||||
|
||||
/**
|
||||
* 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)
|
||||
|
||||
/**
|
||||
* 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)
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ namespace brick {
|
||||
* Set lights.
|
||||
* @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"
|
||||
export function setStatusLight(pattern: number): void {
|
||||
if (currPattern === pattern)
|
||||
|
@ -59,7 +59,7 @@ namespace sensors {
|
||||
* @param handler the code to run when detected
|
||||
*/
|
||||
//% help=input/color/on-color-detected
|
||||
//% block="on %sensor|detected %color"
|
||||
//% block="on `icons.colorSensor` %sensor|detected %color"
|
||||
//% blockId=colorOnColorDetected
|
||||
//% parts="colorsensor"
|
||||
//% blockNamespace=sensors
|
||||
@ -77,7 +77,7 @@ namespace sensors {
|
||||
* @param color the color sensor to query the request
|
||||
*/
|
||||
//% help=input/color/ambient-light
|
||||
//% block="%color| ambient light"
|
||||
//% block="`icons.colorSensor` %color| ambient light"
|
||||
//% blockId=colorGetAmbient
|
||||
//% parts="colorsensor"
|
||||
//% blockNamespace=sensors
|
||||
@ -93,7 +93,7 @@ namespace sensors {
|
||||
* @param color the color sensor to query the request
|
||||
*/
|
||||
//% help=input/color/refelected-light
|
||||
//% block="%color| reflected light"
|
||||
//% block="`icons.colorSensor` %color| reflected light"
|
||||
//% blockId=colorGetReflected
|
||||
//% parts="colorsensor"
|
||||
//% blockNamespace=sensors
|
||||
@ -109,7 +109,7 @@ namespace sensors {
|
||||
* @param color the color sensor to query the request
|
||||
*/
|
||||
//% help=input/color/color
|
||||
//% block="%color| color"
|
||||
//% block="`icons.colorSensor` %color| color"
|
||||
//% blockId=colorGetColor
|
||||
//% parts="colorsensor"
|
||||
//% 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)
|
||||
|
||||
//% whenUsed block="color sensor 1" weight=95 fixedInstance
|
||||
export const color1: ColorSensor = new ColorSensor(1)
|
||||
|
||||
//% whenUsed block="color sensor 2" weight=95 fixedInstance
|
||||
//% whenUsed block="2" weight=90 fixedInstance
|
||||
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)
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ namespace sensors {
|
||||
* @param sensor the gyroscope to query the request
|
||||
*/
|
||||
//% help=input/gyro/angle
|
||||
//% block="%sensor|angle"
|
||||
//% block="`icons.gyroSensor` %sensor|angle"
|
||||
//% blockId=gyroGetAngle
|
||||
//% parts="gyroscope"
|
||||
//% blockNamespace=sensors
|
||||
@ -40,7 +40,7 @@ namespace sensors {
|
||||
* @param sensor the gyroscope to query the request
|
||||
*/
|
||||
//% help=input/gyro/rate
|
||||
//% block="%sensor|rotation rate"
|
||||
//% block="`icons.gyroSensor` %sensor|rotation rate"
|
||||
//% blockId=gyroGetRate
|
||||
//% parts="gyroscope"
|
||||
//% blockNamespace=sensors
|
||||
@ -51,16 +51,16 @@ namespace sensors {
|
||||
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)
|
||||
|
||||
//% 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)
|
||||
|
||||
//% fixedInstance whenUsed block="gyro sensor 4"
|
||||
//% fixedInstance whenUsed block="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
|
||||
*/
|
||||
//% help=input/remote-infrared-beacon/is-pressed
|
||||
//% block="%button|is pressed"
|
||||
//% block="`icons.infraredSensor` %button|is pressed"
|
||||
//% blockId=remoteButtonIsPressed
|
||||
//% parts="remote"
|
||||
//% blockNamespace=sensors
|
||||
@ -108,7 +108,7 @@ namespace sensors {
|
||||
* @param button the remote button to query the request
|
||||
*/
|
||||
//% help=input/remote-infrared-beacon/was-pressed
|
||||
//% block="%button|was pressed"
|
||||
//% block="`icons.infraredSensor` %button|was pressed"
|
||||
//% blockId=remotebuttonWasPressed
|
||||
//% parts="remote"
|
||||
//% blockNamespace=sensors
|
||||
@ -125,7 +125,7 @@ namespace sensors {
|
||||
* @param body code to run when the event is raised
|
||||
*/
|
||||
//% help=input/remote-infrared-beacon/on-event
|
||||
//% blockId=remotebuttonEvent block="on %button|%event"
|
||||
//% blockId=remotebuttonEvent block="on `icons.infraredSensor` %button|%event"
|
||||
//% parts="remote"
|
||||
//% blockNamespace=sensors
|
||||
//% weight=99 blockGap=8
|
||||
@ -193,7 +193,7 @@ namespace sensors {
|
||||
* @param handler the code to run when detected
|
||||
*/
|
||||
//% help=input/infrared/on
|
||||
//% block="on %sensor|%event"
|
||||
//% block="on `icons.infraredSensor` %sensor|%event"
|
||||
//% blockId=infraredOn
|
||||
//% parts="infraredsensor"
|
||||
//% blockNamespace=sensors
|
||||
@ -209,12 +209,12 @@ namespace sensors {
|
||||
* Waits for the event to occur
|
||||
*/
|
||||
//% help=input/ultrasonic/wait
|
||||
//% block="wait %sensor|for %event"
|
||||
//% blockId=ultrasonicWait
|
||||
//% block="wait `icons.infraredSensor` %sensor|for %event"
|
||||
//% blockId=infraredwait
|
||||
//% parts="infraredsensor"
|
||||
//% blockNamespace=sensors
|
||||
//% weight=99 blockGap=8
|
||||
//% group="Ultrasonic Sensor"
|
||||
//% group="Infrared Sensor"
|
||||
wait(event: InfraredSensorEvent) {
|
||||
// TODO
|
||||
}
|
||||
@ -224,7 +224,7 @@ namespace sensors {
|
||||
* @param ir the infrared sensor
|
||||
*/
|
||||
//% help=input/infrared/proximity
|
||||
//% block="%infrared|proximity"
|
||||
//% block="`icons.infraredSensor` %infrared|proximity"
|
||||
//% blockId=infraredGetProximity
|
||||
//% parts="infrared"
|
||||
//% blockNamespace=sensors
|
||||
@ -240,7 +240,7 @@ namespace sensors {
|
||||
* @param ir the infrared sensor
|
||||
*/
|
||||
//% help=input/infrared/remote-command
|
||||
//% block="%infrared|remote command"
|
||||
//% block="`icons.infraredSensor` %infrared|remote command"
|
||||
//% blockId=infraredGetRemoteCommand
|
||||
//% parts="infrared"
|
||||
//% 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)
|
||||
|
||||
//% fixedInstance whenUsed block="infrared sensor 2"
|
||||
//% fixedInstance whenUsed block="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)
|
||||
|
||||
//% fixedInstance whenUsed block="infrared sensor 4"
|
||||
//% fixedInstance whenUsed block="4"
|
||||
export const infraredSensor4: InfraredSensor = new InfraredSensor(4)
|
||||
|
||||
|
||||
/**
|
||||
* Remote beacon (center) button.
|
||||
*/
|
||||
//% whenUsed block="remote button center" weight=95 fixedInstance
|
||||
//% whenUsed block="center" weight=95 fixedInstance
|
||||
export const remoteButtonCenter = irButton(IrRemoteButton.CenterBeacon)
|
||||
|
||||
/**
|
||||
* 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)
|
||||
|
||||
/**
|
||||
* 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)
|
||||
|
||||
/**
|
||||
* 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)
|
||||
|
||||
/**
|
||||
* 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)
|
||||
}
|
||||
|
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 |
@ -352,7 +352,8 @@ void raiseEvent(int id, int event) {
|
||||
pthread_mutex_unlock(&eventMutex);
|
||||
}
|
||||
|
||||
void registerWithDal(int id, int event, Action a) {
|
||||
void registerWithDal(int id, int event, Action a, int flags) {
|
||||
// TODO support flags
|
||||
setBinding(id, event, a);
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,6 @@ namespace brick {
|
||||
}
|
||||
|
||||
//% color="#B4009E" weight=98 icon="\uf192"
|
||||
//% groups='["Touch Sensor", "Color Sensor", "Ultrasonic Sensor", "Infrared Sensor", "Remote Infrared Beacon", "Gyro Sensor"]'
|
||||
//% groups='["Ultrasonic Sensor", "Touch Sensor", "Color Sensor", "Infrared Sensor", "Remote Infrared Beacon", "Gyro Sensor"]'
|
||||
namespace sensors {
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ namespace motors {
|
||||
/**
|
||||
* Stops all motors
|
||||
*/
|
||||
//% blockId=motorStopAll block="stop all motors"
|
||||
//% blockId=motorStopAll block="stop all `icons.motorLarge`"
|
||||
//% weight=10 group="Motors" blockGap=8
|
||||
export function stopAllMotors() {
|
||||
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 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
|
||||
//% power.min=-100 power.max=100
|
||||
power(power: number) {
|
||||
@ -114,7 +114,7 @@ namespace motors {
|
||||
* @param angle the degrees to rotate, eg: 360
|
||||
* @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
|
||||
//% power.min=-100 power.max=100
|
||||
move(angle: number, power: number) {
|
||||
@ -134,7 +134,7 @@ namespace motors {
|
||||
/**
|
||||
* Stops the motor
|
||||
*/
|
||||
//% blockId=motorStop block="stop %motor"
|
||||
//% blockId=motorStop block="stop `icons.motorLarge` %motor"
|
||||
//% weight=97 group="Motors"
|
||||
stop() {
|
||||
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
|
||||
* @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
|
||||
//% weight=60 group="Motors" blockGap=8
|
||||
setBrake(brake: boolean) {
|
||||
@ -156,7 +156,7 @@ namespace motors {
|
||||
/**
|
||||
* Reverses the motor polarity
|
||||
*/
|
||||
//% blockId=motorSetReversed block="set %motor|reversed %reversed"
|
||||
//% blockId=motorSetReversed block="set `icons.motorLarge` %motor|reversed %reversed"
|
||||
//% reversed.fieldEditor=toggleonoff
|
||||
//% weight=59 group="Motors"
|
||||
setReversed(reversed: boolean) {
|
||||
@ -169,7 +169,7 @@ namespace motors {
|
||||
* Gets motor actual speed.
|
||||
* @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
|
||||
speed(): number {
|
||||
return getMotorData(this.port).actualSpeed;
|
||||
@ -179,7 +179,7 @@ namespace motors {
|
||||
* Gets motor step count.
|
||||
* @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
|
||||
count(): number {
|
||||
return getMotorData(this.port).count;
|
||||
@ -189,7 +189,7 @@ namespace motors {
|
||||
* Gets motor tacho count.
|
||||
* @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"
|
||||
tachoCount(): number {
|
||||
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);
|
||||
|
||||
//% whenUsed fixedInstance block="large motor B"
|
||||
//% whenUsed fixedInstance block="large B"
|
||||
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);
|
||||
|
||||
//% whenUsed fixedInstance block="large motor D"
|
||||
//% whenUsed fixedInstance block="large D"
|
||||
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);
|
||||
|
||||
//% whenUsed fixedInstance block="medium motor B"
|
||||
//% whenUsed fixedInstance block="medium B"
|
||||
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);
|
||||
|
||||
//% whenUsed fixedInstance block="medium motor D"
|
||||
//% whenUsed fixedInstance block="medium D"
|
||||
export const mediumMotorD = new Motor(Output.D, false);
|
||||
|
||||
function reset(out: Output) {
|
||||
|
@ -28,6 +28,7 @@
|
||||
"dal.d.ts",
|
||||
"images.ts",
|
||||
"images.jres",
|
||||
"icons.jres",
|
||||
"ns.ts"
|
||||
],
|
||||
"testFiles": [
|
||||
|
@ -84,7 +84,7 @@ namespace brick {
|
||||
* @param x 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"
|
||||
//% x.min=0 x.max=178 y.min=0 y.max=128 on.fieldEditor=toggleonoff
|
||||
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 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
|
||||
//% x.min=0 x.max=178 y.min=0 y.max=128
|
||||
export function print(text: string, x: number, y: number, mode = Draw.Normal) {
|
||||
@ -133,6 +133,32 @@ namespace brick {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows an image on screen
|
||||
* @param image image to draw
|
||||
*/
|
||||
//% blockId=screen_show_image block="`icons.brickDisplay` show image %image=scren_image_picker"
|
||||
//% weight=95 group="Screen" blockGap=8
|
||||
export function showImage(image: Image, delay: number = 400) {
|
||||
if (!image) return;
|
||||
image.draw(0, 0, Draw.Normal);
|
||||
delay = Math.max(0, delay);
|
||||
loops.pause(delay);
|
||||
}
|
||||
|
||||
/**
|
||||
* An image
|
||||
* @param image the image
|
||||
*/
|
||||
//% blockId=scren_image_picker block="%image" shim=TD_ID
|
||||
//% image.fieldEditor="imagedropdown"
|
||||
//% image.fieldOptions.columns=6
|
||||
//% block.fieldOptions.hasSearchBar=true
|
||||
//% group="Screen" weight=0 blockHidden=1
|
||||
export function _imagePicker(image: Image): Image {
|
||||
return image;
|
||||
}
|
||||
|
||||
export function drawRect(x: number, y: number, w: number, h: number, mode = Draw.Normal) {
|
||||
x |= 0;
|
||||
y |= 0;
|
||||
|
@ -35,12 +35,28 @@ namespace sensors {
|
||||
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.
|
||||
* @param sensor the port to query the request
|
||||
*/
|
||||
//% help=input/touch/is-touched
|
||||
//% block="%sensor|is touched"
|
||||
//% block="`icons.touchSensor` %sensor|is touched"
|
||||
//% blockId=touchIsTouched
|
||||
//% parts="touch"
|
||||
//% blockNamespace=sensors
|
||||
@ -49,30 +65,14 @@ namespace sensors {
|
||||
isTouched() {
|
||||
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)
|
||||
//% whenUsed block="touch sensor 2" weight=95 fixedInstance
|
||||
//% whenUsed block="2" weight=95 fixedInstance
|
||||
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)
|
||||
//% whenUsed block="touch sensor 4" weight=95 fixedInstance
|
||||
//% whenUsed block="4" weight=95 fixedInstance
|
||||
export const touchSensor4: TouchSensor = new TouchSensor(4)
|
||||
}
|
||||
|
@ -41,9 +41,9 @@ namespace sensors {
|
||||
* @param handler the code to run when detected
|
||||
*/
|
||||
//% help=input/ultrasonic/on
|
||||
//% block="on %sensor|%event"
|
||||
//% blockId=ultrasonicOn
|
||||
//% parts="infraredsensor"
|
||||
//% block="on `icons.ultrasonicSensor` %sensor|%event"
|
||||
//% parts="ultrasonicsensor"
|
||||
//% blockNamespace=sensors
|
||||
//% weight=100 blockGap=8
|
||||
//% group="Ultrasonic Sensor"
|
||||
@ -58,9 +58,9 @@ namespace sensors {
|
||||
* Waits for the event to occur
|
||||
*/
|
||||
//% help=input/ultrasonic/wait
|
||||
//% block="wait %sensor|for %event"
|
||||
//% block="wait `icons.ultrasonicSensor` %sensor|for %event"
|
||||
//% blockId=ultrasonicWait
|
||||
//% parts="infraredsensor"
|
||||
//% parts="ultrasonicsensor"
|
||||
//% blockNamespace=sensors
|
||||
//% weight=99 blockGap=8
|
||||
//% group="Ultrasonic Sensor"
|
||||
@ -73,9 +73,9 @@ namespace sensors {
|
||||
* @param sensor the ultrasonic sensor port
|
||||
*/
|
||||
//% help=input/ultrasonic/distance
|
||||
//% block="%sensor|distance"
|
||||
//% block="`icons.ultrasonicSensor` %sensor|distance"
|
||||
//% blockId=sonarGetDistance
|
||||
//% parts="ultrasonic"
|
||||
//% parts="ultrasonicsensor"
|
||||
//% blockNamespace=sensors
|
||||
//% weight=65 blockGap=8
|
||||
//% group="Ultrasonic Sensor"
|
||||
@ -85,16 +85,16 @@ namespace sensors {
|
||||
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)
|
||||
|
||||
//% 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)
|
||||
|
||||
//% fixedInstance whenUsed block="ultrasonic sensor 3"
|
||||
//% fixedInstance whenUsed block="3"
|
||||
export const ultrasonic3: UltraSonicSensor = new UltraSonicSensor(3)
|
||||
}
|
||||
|
@ -2,6 +2,8 @@
|
||||
"Sound.buffer": "Returns the underlaying Buffer object.",
|
||||
"Sound.play": "Play sound.",
|
||||
"music": "Generation of music tones.",
|
||||
"music._soundPicker": "A sound",
|
||||
"music._soundPicker|param|sound": "the sound",
|
||||
"music.beat": "Return the duration of a beat in milliseconds (the beat fraction).",
|
||||
"music.beat|param|fraction": "the fraction of the current whole note, eg: BeatFraction.Half",
|
||||
"music.changeTempoBy": "Change the tempo up or down by some amount of beats per minute (bpm).",
|
||||
@ -10,6 +12,8 @@
|
||||
"music.noteFrequency": "Get the frequency of a note.",
|
||||
"music.noteFrequency|param|name": "the note name, eg: Note.C",
|
||||
"music.playSound": "Start playing a sound and don't wait for it to finish.\nNotes are expressed as a string of characters with this format: NOTE[octave][:duration]",
|
||||
"music.playSoundEffect": "Plays a sound",
|
||||
"music.playSoundEffect|param|sound": "the sound to play",
|
||||
"music.playSoundUntilDone": "Play a sound and wait until the sound is done.\nNotes are expressed as a string of characters with this format: NOTE[octave][:duration]",
|
||||
"music.playSoundUntilDone|param|sound": "the melody to play, eg: music.sounds(Sounds.PowerUp)",
|
||||
"music.playSound|param|sound": "the melody to play, eg: music.sounds(Sounds.PowerUp)",
|
||||
|
@ -28,9 +28,11 @@
|
||||
"Sounds.PowerUp|block": "power up",
|
||||
"Sounds.Siren|block": "siren",
|
||||
"Sounds.Wawawawaa|block": "wawawawaa",
|
||||
"music._soundPicker|block": "%sound",
|
||||
"music.beat|block": "%fraction|beat",
|
||||
"music.changeTempoBy|block": "change tempo by %value|(bpm)",
|
||||
"music.noteFrequency|block": "%note",
|
||||
"music.playSoundEffect|block": "play %sound",
|
||||
"music.playSoundUntilDone|block": "play sound %sound=music_sounds|until done",
|
||||
"music.playSound|block": "play sound %sound=music_sounds",
|
||||
"music.playTone|block": "play tone|at %note=device_note|for %duration=device_beat",
|
||||
@ -42,6 +44,133 @@
|
||||
"music.stopAllSounds|block": "stop all sounds",
|
||||
"music.tempo|block": "tempo (bpm)",
|
||||
"music|block": "music",
|
||||
"sounds.animalsCatPurr|block": "Animals cat purr",
|
||||
"sounds.animalsDogBark1|block": "Animals dog bark 1",
|
||||
"sounds.animalsDogBark2|block": "Animals dog bark 2",
|
||||
"sounds.animalsDogGrowl|block": "Animals dog growl",
|
||||
"sounds.animalsDogSniff|block": "Animals dog sniff",
|
||||
"sounds.animalsDogWhine|block": "Animals dog whine",
|
||||
"sounds.animalsElephantCall|block": "Animals elephant call",
|
||||
"sounds.animalsInsectBuzz1|block": "Animals insect buzz1",
|
||||
"sounds.animalsInsectBuzz2|block": "Animals insect buzz2",
|
||||
"sounds.animalsInsectChirp|block": "Animals insect chirp",
|
||||
"sounds.animalsSnakeHiss|block": "Animals snake hiss",
|
||||
"sounds.animalsSnakeRattle|block": "Animals snake rattle",
|
||||
"sounds.animalsTRexRoar|block": "Animals trex roar",
|
||||
"sounds.colorsBlack|block": "Colors black",
|
||||
"sounds.colorsBlue|block": "Colors blue",
|
||||
"sounds.colorsBrown|block": "Colors brown",
|
||||
"sounds.colorsGreen|block": "Colors green",
|
||||
"sounds.colorsRed|block": "Colors red",
|
||||
"sounds.colorsWhite|block": "Colors white",
|
||||
"sounds.colorsYellow|block": "Colors yellow",
|
||||
"sounds.communicationBravo|block": "Communication bravo",
|
||||
"sounds.communicationEv3|block": "Communication ev3",
|
||||
"sounds.communicationFantastic|block": "Communication fantastic",
|
||||
"sounds.communicationGameOver|block": "Communication game over",
|
||||
"sounds.communicationGoodJob|block": "communicationGoodJob",
|
||||
"sounds.communicationGoodbye|block": "communication goodbye",
|
||||
"sounds.communicationGood|block": "communication good",
|
||||
"sounds.communicationGo|block": "Communication go",
|
||||
"sounds.communicationHello|block": "communication hello",
|
||||
"sounds.communicationHi|block": "communication hi",
|
||||
"sounds.communicationLego|block": "communication lego",
|
||||
"sounds.communicationMindstorms|block": "communication mindstorms",
|
||||
"sounds.communicationMorning|block": "communication morning",
|
||||
"sounds.communicationNo|block": "communication no",
|
||||
"sounds.communicationOkay|block": "communication okay",
|
||||
"sounds.communicationOkeyDokey|block": "communication okey dokey",
|
||||
"sounds.communicationSorry|block": "communication sorry",
|
||||
"sounds.communicationThankYou|block": "communication thank you",
|
||||
"sounds.communicationYes|block": "communication yes",
|
||||
"sounds.expressionsBoing|block": "expressions boing",
|
||||
"sounds.expressionsBoo|block": "expressions boo",
|
||||
"sounds.expressionsCheering|block": "expressions cheering",
|
||||
"sounds.expressionsCrunching|block": "expressions crunching",
|
||||
"sounds.expressionsCrying|block": "expressions crying",
|
||||
"sounds.expressionsFanfare|block": "expressions fanfare",
|
||||
"sounds.expressionsKungFu|block": "expressions kung fu",
|
||||
"sounds.expressionsLaughing1|block": "expressions laughing1",
|
||||
"sounds.expressionsLaughing2|block": "expressions laughing2",
|
||||
"sounds.expressionsMagicWand|block": "expressions magic wand",
|
||||
"sounds.expressionsOuch|block": "expressions ouch",
|
||||
"sounds.expressionsShouting|block": "expressions shouting",
|
||||
"sounds.expressionsSmack|block": "expressions smack",
|
||||
"sounds.expressionsSneezing|block": "expressions sneezing",
|
||||
"sounds.expressionsSnoring|block": "expressions snoring",
|
||||
"sounds.expressionsUhOh|block": "expressions uh oh",
|
||||
"sounds.informationActivate|block": "information activate",
|
||||
"sounds.informationAnalyze|block": "information analyze",
|
||||
"sounds.informationBackwards|block": "information backwards",
|
||||
"sounds.informationColor|block": "information color",
|
||||
"sounds.informationDetected|block": "information detected",
|
||||
"sounds.informationDown|block": "information down",
|
||||
"sounds.informationErrorAlarm|block": "information error alarm",
|
||||
"sounds.informationError|block": "information error",
|
||||
"sounds.informationFlashing|block": "information flashing",
|
||||
"sounds.informationForward|block": "information forward",
|
||||
"sounds.informationLeft|block": "information left",
|
||||
"sounds.informationObject|block": "information object",
|
||||
"sounds.informationRight|block": "information right",
|
||||
"sounds.informationSearching|block": "information searching",
|
||||
"sounds.informationStart|block": "information start",
|
||||
"sounds.informationStop|block": "information stop",
|
||||
"sounds.informationTouch|block": "information touch",
|
||||
"sounds.informationTurn|block": "information turn",
|
||||
"sounds.informationUp|block": "information up",
|
||||
"sounds.mechanicalAirRelease|block": "mechanical air release",
|
||||
"sounds.mechanicalAirbrake|block": "mechanical airbrake",
|
||||
"sounds.mechanicalBackingAlert|block": "mechanical backing alert",
|
||||
"sounds.mechanicalBlip1|block": "mechanical blip1",
|
||||
"sounds.mechanicalBlip2|block": "mechanical blip2",
|
||||
"sounds.mechanicalBlip3|block": "mechanical blip3",
|
||||
"sounds.mechanicalBlip4|block": "mechanical blip4",
|
||||
"sounds.mechanicalHorn1|block": "mechanical horn1",
|
||||
"sounds.mechanicalHorn2|block": "mechanical horn2",
|
||||
"sounds.mechanicalLaser|block": "mechanical laser",
|
||||
"sounds.mechanicalMotorIdle|block": "mechanical motor idle",
|
||||
"sounds.mechanicalMotorStart|block": "mechanical motor start",
|
||||
"sounds.mechanicalMotorStop|block": "mechanical motor stop",
|
||||
"sounds.mechanicalRatchet|block": "mechanical ratchet",
|
||||
"sounds.mechanicalSonar|block": "\"mechanical sonar\"",
|
||||
"sounds.mechanicalTickTack|block": "mechanical tick tack",
|
||||
"sounds.mechanicalWalk|block": "mechanical walk",
|
||||
"sounds.movementsArm1|block": "movements arm1",
|
||||
"sounds.movementsArm2|block": "movements arm2",
|
||||
"sounds.movementsArm3|block": "movements arm3",
|
||||
"sounds.movementsArm4|block": "movements arm4",
|
||||
"sounds.movementsDropLoad|block": "movements drop load",
|
||||
"sounds.movementsLiftLoad|block": "movements lift load",
|
||||
"sounds.movementsServo1|block": "movements servo1",
|
||||
"sounds.movementsServo2|block": "movements servo2",
|
||||
"sounds.movementsServo3|block": "movements servo3",
|
||||
"sounds.movementsServo4|block": "movements servo4",
|
||||
"sounds.movementsSlideLoad|block": "movements slide load",
|
||||
"sounds.movementsSnap|block": "movements snap",
|
||||
"sounds.movementsSpeedDown|block": "movements speed down",
|
||||
"sounds.movementsSpeedIdle|block": "movements speed idle",
|
||||
"sounds.movementsSpeedUp|block": "movements speed up",
|
||||
"sounds.movementsSpeeding|block": "movements speeding",
|
||||
"sounds.numbersEight|block": "numbers eight",
|
||||
"sounds.numbersFive|block": "numbers five",
|
||||
"sounds.numbersFour|block": "numbers four",
|
||||
"sounds.numbersNine|block": "numbers nine",
|
||||
"sounds.numbersOne|block": "numbers one",
|
||||
"sounds.numbersSeven|block": "numbers seven",
|
||||
"sounds.numbersSix|block": "numbers six",
|
||||
"sounds.numbersTen|block": "numbers ten",
|
||||
"sounds.numbersThree|block": "numbers three",
|
||||
"sounds.numbersTwo|block": "numbers two",
|
||||
"sounds.numbersZero|block": "numbers zero",
|
||||
"sounds.systemClick|block": "system click",
|
||||
"sounds.systemConfirm|block": "system confirm",
|
||||
"sounds.systemConnect|block": "system connect",
|
||||
"sounds.systemDownload|block": "system download",
|
||||
"sounds.systemGeneralAlert|block": "system general alert",
|
||||
"sounds.systemOverpower|block": "system overpower",
|
||||
"sounds.systemPowerDown|block": "system power down",
|
||||
"sounds.systemReady|block": "system ready",
|
||||
"sounds.systemStartUp|block": "S",
|
||||
"{id:category}Music": "Music",
|
||||
"{id:category}Sound": "Sound",
|
||||
"{id:category}Sounds": "Sounds"
|
||||
|
@ -1,256 +1,280 @@
|
||||
namespace sounds {
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Animals cat purr"
|
||||
export const animalsCatPurr = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Animals dog bark 1"
|
||||
export const animalsDogBark1 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Animals dog bark 2"
|
||||
export const animalsDogBark2 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Animals dog growl"
|
||||
export const animalsDogGrowl = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Animals dog sniff"
|
||||
export const animalsDogSniff = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Animals dog whine"
|
||||
export const animalsDogWhine = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Animals elephant call"
|
||||
export const animalsElephantCall = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Animals insect buzz1"
|
||||
export const animalsInsectBuzz1 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Animals insect buzz2"
|
||||
export const animalsInsectBuzz2 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Animals insect chirp"
|
||||
export const animalsInsectChirp = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Animals snake hiss"
|
||||
export const animalsSnakeHiss = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Animals snake rattle"
|
||||
export const animalsSnakeRattle = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Animals trex roar"
|
||||
export const animalsTRexRoar = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Colors black"
|
||||
export const colorsBlack = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Colors blue"
|
||||
export const colorsBlue = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Colors brown"
|
||||
export const colorsBrown = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Colors green"
|
||||
export const colorsGreen = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Colors red"
|
||||
export const colorsRed = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Colors white"
|
||||
export const colorsWhite = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Colors yellow"
|
||||
export const colorsYellow = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Communication bravo"
|
||||
export const communicationBravo = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Communication ev3"
|
||||
export const communicationEv3 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Communication fantastic"
|
||||
export const communicationFantastic = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Communication game over"
|
||||
export const communicationGameOver = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="Communication go"
|
||||
export const communicationGo = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="communicationGoodJob"
|
||||
export const communicationGoodJob = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="communication good"
|
||||
export const communicationGood = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="communication goodbye"
|
||||
export const communicationGoodbye = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="communication hello"
|
||||
export const communicationHello = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="communication hi"
|
||||
export const communicationHi = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="communication lego"
|
||||
export const communicationLego = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="communication mindstorms"
|
||||
export const communicationMindstorms = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="communication morning"
|
||||
export const communicationMorning = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="communication no"
|
||||
export const communicationNo = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="communication okay"
|
||||
export const communicationOkay = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="communication okey dokey"
|
||||
export const communicationOkeyDokey = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="communication sorry"
|
||||
export const communicationSorry = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="communication thank you"
|
||||
export const communicationThankYou = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="communication yes"
|
||||
export const communicationYes = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="expressions boing"
|
||||
export const expressionsBoing = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="expressions boo"
|
||||
export const expressionsBoo = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="expressions cheering"
|
||||
export const expressionsCheering = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="expressions crunching"
|
||||
export const expressionsCrunching = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="expressions crying"
|
||||
export const expressionsCrying = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="expressions fanfare"
|
||||
export const expressionsFanfare = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="expressions kung fu"
|
||||
export const expressionsKungFu = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="expressions laughing1"
|
||||
export const expressionsLaughing1 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="expressions laughing2"
|
||||
export const expressionsLaughing2 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="expressions magic wand"
|
||||
export const expressionsMagicWand = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="expressions ouch"
|
||||
export const expressionsOuch = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="expressions shouting"
|
||||
export const expressionsShouting = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="expressions smack"
|
||||
export const expressionsSmack = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="expressions sneezing"
|
||||
export const expressionsSneezing = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="expressions snoring"
|
||||
export const expressionsSnoring = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="expressions uh oh"
|
||||
export const expressionsUhOh = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information activate"
|
||||
export const informationActivate = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information analyze"
|
||||
export const informationAnalyze = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information backwards"
|
||||
export const informationBackwards = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information color"
|
||||
export const informationColor = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information detected"
|
||||
export const informationDetected = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information down"
|
||||
export const informationDown = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information error alarm"
|
||||
export const informationErrorAlarm = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information error"
|
||||
export const informationError = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information flashing"
|
||||
export const informationFlashing = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information forward"
|
||||
export const informationForward = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information left"
|
||||
export const informationLeft = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information object"
|
||||
export const informationObject = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information right"
|
||||
export const informationRight = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information searching"
|
||||
export const informationSearching = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information start"
|
||||
export const informationStart = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information stop"
|
||||
export const informationStop = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information touch"
|
||||
export const informationTouch = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information turn"
|
||||
export const informationTurn = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="information up"
|
||||
export const informationUp = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="mechanical air release"
|
||||
export const mechanicalAirRelease = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="mechanical airbrake"
|
||||
export const mechanicalAirbrake = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="mechanical backing alert"
|
||||
export const mechanicalBackingAlert = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="mechanical blip1"
|
||||
export const mechanicalBlip1 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="mechanical blip2"
|
||||
export const mechanicalBlip2 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="mechanical blip3"
|
||||
export const mechanicalBlip3 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="mechanical blip4"
|
||||
export const mechanicalBlip4 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="mechanical horn1"
|
||||
export const mechanicalHorn1 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="mechanical horn2"
|
||||
export const mechanicalHorn2 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="mechanical laser"
|
||||
export const mechanicalLaser = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="mechanical motor idle"
|
||||
export const mechanicalMotorIdle = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="mechanical motor start"
|
||||
export const mechanicalMotorStart = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="mechanical motor stop"
|
||||
export const mechanicalMotorStop = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="mechanical ratchet"
|
||||
export const mechanicalRatchet = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block='"mechanical sonar"'
|
||||
export const mechanicalSonar = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="mechanical tick tack"
|
||||
export const mechanicalTickTack = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="mechanical walk"
|
||||
export const mechanicalWalk = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="movements arm1"
|
||||
export const movementsArm1 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="movements arm2"
|
||||
export const movementsArm2 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="movements arm3"
|
||||
export const movementsArm3 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="movements arm4"
|
||||
export const movementsArm4 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="movements drop load"
|
||||
export const movementsDropLoad = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="movements lift load"
|
||||
export const movementsLiftLoad = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="movements servo1"
|
||||
export const movementsServo1 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="movements servo2"
|
||||
export const movementsServo2 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="movements servo3"
|
||||
export const movementsServo3 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="movements servo4"
|
||||
export const movementsServo4 = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="movements slide load"
|
||||
export const movementsSlideLoad = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="movements snap"
|
||||
export const movementsSnap = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="movements speed down"
|
||||
export const movementsSpeedDown = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="movements speed idle"
|
||||
export const movementsSpeedIdle = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="movements speed up"
|
||||
export const movementsSpeedUp = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="movements speeding"
|
||||
export const movementsSpeeding = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="numbers eight"
|
||||
export const numbersEight = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="numbers five"
|
||||
export const numbersFive = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="numbers four"
|
||||
export const numbersFour = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="numbers nine"
|
||||
export const numbersNine = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="numbers one"
|
||||
export const numbersOne = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="numbers seven"
|
||||
export const numbersSeven = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="numbers six"
|
||||
export const numbersSix = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="numbers ten"
|
||||
export const numbersTen = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="numbers three"
|
||||
export const numbersThree = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="numbers two"
|
||||
export const numbersTwo = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="numbers zero"
|
||||
export const numbersZero = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="system click"
|
||||
export const systemClick = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="system confirm"
|
||||
export const systemConfirm = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="system connect"
|
||||
export const systemConnect = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="system download"
|
||||
export const systemDownload = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="system general alert"
|
||||
export const systemGeneralAlert = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="system overpower"
|
||||
export const systemOverpower = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="system power down"
|
||||
export const systemPowerDown = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block="system ready"
|
||||
export const systemReady = music.fromWAV(hex``);
|
||||
//% fixedInstance jres
|
||||
//% fixedInstance jres block=S
|
||||
export const systemStartUp = music.fromWAV(hex``);
|
||||
}
|
||||
|
||||
namespace music {
|
||||
/**
|
||||
* Plays a sound
|
||||
* @param sound the sound to play
|
||||
*/
|
||||
//% blockId=music_play_sound_effect block="play %sound"
|
||||
//% weight=98
|
||||
export function playSoundEffect(sound: Sound) {
|
||||
if (!sound) return;
|
||||
|
||||
sound.play();
|
||||
}
|
||||
|
||||
/**
|
||||
* A sound
|
||||
* @param sound the sound
|
||||
*/
|
||||
//% blockId=music_sound_picker block="%sound" shim=TD_ID
|
||||
//% weight=0 blockHidden=1
|
||||
export function _soundPicker(sound: Sound): Sound {
|
||||
return sound;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pxt-ev3",
|
||||
"version": "0.0.28",
|
||||
"version": "0.0.33",
|
||||
"description": "LEGO Mindstorms EV3 for Microsoft MakeCode",
|
||||
"private": true,
|
||||
"keywords": [
|
||||
@ -39,8 +39,8 @@
|
||||
"semantic-ui-less": "^2.2.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"pxt-common-packages": "0.12.4",
|
||||
"pxt-core": "2.3.6"
|
||||
"pxt-common-packages": "0.14.3",
|
||||
"pxt-core": "2.3.28"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node node_modules/pxt-core/built/pxt.js travis"
|
||||
|
@ -43,10 +43,10 @@
|
||||
}
|
||||
|
||||
/* Menu bar colors */
|
||||
#menubar .ui.item {
|
||||
.menubar .ui.item {
|
||||
color: #373737;
|
||||
}
|
||||
.fullscreensim #menubar .ui.menu {
|
||||
.fullscreensim .menubar .ui.menu {
|
||||
box-shadow: none !important;
|
||||
border-bottom: 0 !important;
|
||||
}
|
||||
@ -57,17 +57,17 @@
|
||||
}
|
||||
|
||||
/* Editor menu toggle */
|
||||
#menubar .ui.menu.fixed .item.editor-menuitem .ui.grid {
|
||||
.menubar .ui.menu.fixed .item.editor-menuitem .ui.grid {
|
||||
background: @blue !important;
|
||||
border-radius: 0px !important;
|
||||
}
|
||||
#menubar .ui.menu.fixed .ui.item.editor-menuitem .item:not(.active) {
|
||||
.menubar .ui.menu.fixed .ui.item.editor-menuitem .item:not(.active) {
|
||||
color: white;
|
||||
}
|
||||
#menubar .ui.menu.fixed .ui.item.editor-menuitem .item {
|
||||
.menubar .ui.menu.fixed .ui.item.editor-menuitem .item {
|
||||
border-radius: 0px !important;
|
||||
}
|
||||
#menubar .ui.menu.fixed .ui.item.editor-menuitem .item.active {
|
||||
.menubar .ui.menu.fixed .ui.item.editor-menuitem .item.active {
|
||||
color: @blue;
|
||||
}
|
||||
|
||||
|