'use strict'; goog.provide('Blockly.Blocks.microbit'); goog.require('Blockly.Blocks'); goog.require('Blockly.constants'); //Blockly.FieldColour.COLOURS = "#f00 #e00 #d00 #c00 #b00 #a00 #800 #600 #400 #000".split(" "); //Blockly.FieldColour.COLUMNS = 5; Blockly.Blocks.botbit_rec_from_microbit = { init: function () { this.jsonInit({ inputsInline: !0, nextStatement: null, previousStatement: null, colour: 30, helpUrl: Blockly.Msg.BOTBIT_REC_FROM_MICROBIT_HELPURL, tooltip: Blockly.Msg.BOTBIT_REC_FROM_MICROBIT_TOOLTIP, message0: Blockly.Msg.BOTBIT_REC_FROM_MICROBIT_MESSAGE0 }) } }; Blockly.Blocks.microbit_update_msg_args = { init: function () { this.jsonInit({ inputsInline: !1, nextStatement: null, previousStatement: null, colour: 30, helpUrl: Blockly.Msg.MICROBIT_UPDATE_MSG_ARGS_HELPURL, tooltip: Blockly.Msg.MICROBIT_UPDATE_MSG_ARGS_TOOLTIP, message0: Blockly.Msg.MICROBIT_UPDATE_MSG_ARGS_MESSAGE0, args0: [{ type: "input_value", name: "msg" }, { type: "input_dummy" }, { check: "Number", type: "input_value", name: "x" }, { check: "Number", type: "input_value", name: "y" }, { check: "Number", type: "input_value", name: "z" }, { check: "Boolean", type: "input_value", name: "L" }, { check: "Boolean", type: "input_value", name: "R" }] }) } }; Blockly.Blocks.microbit_accelerometer_get_x = { init: function () { this.jsonInit({ colour: 0, output: "Number", helpUrl: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_X_HELPURL, tooltip: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_X_TOOLTIP, message0: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_X_MESSAGE0 }) } }; Blockly.Blocks.microbit_accelerometer_get_y = { init: function () { this.jsonInit({ colour: 0, output: "Number", helpUrl: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_Y_HELPURL, tooltip: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_Y_TOOLTIP, message0: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_Y_MESSAGE0 }) } }; Blockly.Blocks.microbit_accelerometer_get_z = { init: function () { this.jsonInit({ colour: 0, output: "Number", helpUrl: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_Z_HELPURL, tooltip: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_Z_TOOLTIP, message0: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_Z_MESSAGE0 }) } }; Blockly.Blocks.microbit_accelerometer_was_gesture = { init: function () { this.jsonInit({ colour: 0, args0: [{ name: "gesture", options: [[Blockly.Msg.MICROBIT_GESTURE_SHAKE, "shake"], [Blockly.Msg.MICROBIT_GESTURE_UP, "up"], [Blockly.Msg.MICROBIT_GESTURE_DOWN, "down"], [Blockly.Msg.MICROBIT_GESTURE_LEFT, "left"], [Blockly.Msg.MICROBIT_GESTURE_RIGHT, "right"], [Blockly.Msg.MICROBIT_GESTURE_FACE_UP, "face up"], [Blockly.Msg.MICROBIT_GESTURE_FACE_DOWN, "face down"], [Blockly.Msg.MICROBIT_GESTURE_FREEFAIL, "freefall"], ["3g", "3g"], ["6g", "6g"], ["8g", "8g"]], type: "field_dropdown" }], output: "Boolean", helpUrl: Blockly.Msg.MICROBIT_ACCELEROMETER_WAS_GESTURE_HELPURL, tooltip: Blockly.Msg.MICROBIT_ACCELEROMETER_WAS_GESTURE_TOOLTIP, message0: Blockly.Msg.MICROBIT_ACCELEROMETER_WAS_GESTURE_MESSAGE0 }) } }; Blockly.Blocks.microbit_accelerometer_is_gesture = { init: function () { this.jsonInit({ colour: 0, args0: [{ name: "gesture", options: [[Blockly.Msg.MICROBIT_GESTURE_SHAKE, "shake"], [Blockly.Msg.MICROBIT_GESTURE_UP, "up"], [Blockly.Msg.MICROBIT_GESTURE_DOWN, "down"], [Blockly.Msg.MICROBIT_GESTURE_LEFT, "left"], [Blockly.Msg.MICROBIT_GESTURE_RIGHT, "right"], [Blockly.Msg.MICROBIT_GESTURE_FACE_UP, "face up"], [Blockly.Msg.MICROBIT_GESTURE_FACE_DOWN, "face down"], [Blockly.Msg.MICROBIT_GESTURE_FREEFAIL, "freefall"], ["3g", "3g"], ["6g", "6g"], ["8g", "8g"]], type: "field_dropdown" }], output: "Boolean", helpUrl: Blockly.Msg.MICROBIT_ACCELEROMETER_IS_GESTURE_HELPURL, tooltip: Blockly.Msg.MICROBIT_ACCELEROMETER_IS_GESTURE_TOOLTIP, message0: Blockly.Msg.MICROBIT_ACCELEROMETER_IS_GESTURE_MESSAGE0 }) } }; Blockly.Blocks.microbit_accelerometer_get_gestures = { init: function () { this.jsonInit({ colour: 0, output: "Array", helpUrl: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_GESTURES_HELPURL, tooltip: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_GESTURES_TOOLTIP, message0: Blockly.Msg.MICROBIT_ACCELEROMETER_GET_GESTURES_MESSAGE0 }) } }; Blockly.Blocks.microbit_accelerometer_current_gesture = { init: function () { this.jsonInit({ colour: 0, output: "String", helpUrl: Blockly.Msg.MICROBIT_ACCELEROMETER_CURRENT_GESTURE_HELPURL, tooltip: Blockly.Msg.MICROBIT_ACCELEROMETER_CURRENT_GESTURE_TOOLTIP, message0: Blockly.Msg.MICROBIT_ACCELEROMETER_CURRENT_GESTURE_MESSAGE0 }) } }; Blockly.Blocks.microbit_button_is_pressed = { init: function () { this.jsonInit({ colour: 32, args0: [{ name: "button", options: [["A", "a"], ["B", "b"]], type: "field_dropdown" }], output: "Boolean", helpUrl: Blockly.Msg.MICROBIT_BUTTON_IS_PRESSED_HELPURL, tooltip: Blockly.Msg.MICROBIT_BUTTON_IS_PRESSED_TOOLTIP, message0: Blockly.Msg.MICROBIT_BUTTON_IS_PRESSED_MESSAGE0 }) } }; Blockly.Blocks.microbit_button_was_pressed = { init: function () { this.jsonInit({ colour: 32, args0: [{ name: "button", options: [["A", "a"], ["B", "b"]], type: "field_dropdown" }], output: "Boolean", helpUrl: Blockly.Msg.MICROBIT_BUTTON_WAS_PRESSED_HELPURL, tooltip: Blockly.Msg.MICROBIT_BUTTON_WAS_PRESSED_TOOLTIP, message0: Blockly.Msg.MICROBIT_BUTTON_WAS_PRESSED_MESSAGE0 }) } }; Blockly.Blocks.microbit_button_get_presses = { init: function () { this.jsonInit({ colour: 32, args0: [{ name: "button", options: [["A", "a"], ["B", "b"]], type: "field_dropdown" }], output: "Number", helpUrl: Blockly.Msg.MICROBIT_BUTTON_GET_PRESSES_HELPURL, tooltip: Blockly.Msg.MICROBIT_BUTTON_GET_PRESSES_TOOLTIP, message0: Blockly.Msg.MICROBIT_BUTTON_GET_PRESSES_MESSAGE0 }) } }; Blockly.Blocks.microbit_compass_calibrate = { init: function () { this.jsonInit({ colour: 64, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_COMPASS_CALIBRATE_HELPURL, tooltip: Blockly.Msg.MICROBIT_COMPASS_CALIBRATE_TOOLTIP, message0: Blockly.Msg.MICROBIT_COMPASS_CALIBRATE_MESSAGE0 }) } }; Blockly.Blocks.microbit_compass_is_calibrated = { init: function () { this.jsonInit({ colour: 64, output: "Boolean", helpUrl: Blockly.Msg.MICROBIT_COMPASS_IS_CALIBRATED_HELPURL, tooltip: Blockly.Msg.MICROBIT_COMPASS_IS_CALIBRATED_TOOLTIP, message0: Blockly.Msg.MICROBIT_COMPASS_IS_CALIBRATED_MESSAGE0 }) } }; Blockly.Blocks.microbit_compass_heading = { init: function () { this.jsonInit({ colour: 64, output: "Number", helpUrl: Blockly.Msg.MICROBIT_COMPASS_HEADING_HELPURL, tooltip: Blockly.Msg.MICROBIT_COMPASS_HEADING_TOOLTIP, message0: Blockly.Msg.MICROBIT_COMPASS_HEADING_MESSAGE0 }) } }; Blockly.Blocks.microbit_compass_get_field_strength = { init: function () { this.jsonInit({ colour: 64, output: "Number", helpUrl: Blockly.Msg.MICROBIT_COMPASS_GET_FIELD_STRENGTH_HELPURL, tooltip: Blockly.Msg.MICROBIT_COMPASS_GET_FIELD_STRENGTH_TOOLTIP, message0: Blockly.Msg.MICROBIT_COMPASS_GET_FIELD_STRENGTH_MESSAGE0 }) } }; Blockly.Blocks.microbit_compass_x = { init: function () { this.jsonInit({ colour: 64, output: "Number", helpUrl: Blockly.Msg.MICROBIT_COMPASS_X_HELPURL, tooltip: Blockly.Msg.MICROBIT_COMPASS_X_TOOLTIP, message0: Blockly.Msg.MICROBIT_COMPASS_X_MESSAGE0 }) } }; Blockly.Blocks.microbit_compass_y = { init: function () { this.jsonInit({ colour: 64, output: "Number", helpUrl: Blockly.Msg.MICROBIT_COMPASS_Y_HELPURL, tooltip: Blockly.Msg.MICROBIT_COMPASS_Y_TOOLTIP, message0: Blockly.Msg.MICROBIT_COMPASS_Y_MESSAGE0 }) } }; Blockly.Blocks.microbit_compass_z = { init: function () { this.jsonInit({ colour: 64, output: "Number", helpUrl: Blockly.Msg.MICROBIT_COMPASS_Z_HELPURL, tooltip: Blockly.Msg.MICROBIT_COMPASS_Z_TOOLTIP, message0: Blockly.Msg.MICROBIT_COMPASS_Z_MESSAGE0 }) } }; Blockly.Blocks.microbit_display_get_pixel = { init: function () { this.jsonInit({ args0: [{ check: "Number", type: "input_value", name: "x" }, { check: "Number", type: "input_value", name: "y" }], inputsInline: !0, output: "Number", colour: 96, helpUrl: Blockly.Msg.MICROBIT_DISPLAY_GET_PIXEL_HELPURL, tooltip: Blockly.Msg.MICROBIT_DISPLAY_GET_PIXEL_TOOLTIP, message0: Blockly.Msg.MICROBIT_DISPLAY_GET_PIXEL_MESSAGE0 }) } }; Blockly.Blocks.microbit_display_set_pixel = { init: function () { this.jsonInit({ inputsInline: !0, nextStatement: null, previousStatement: null, colour: 96, helpUrl: Blockly.Msg.MICROBIT_DISPLAY_SET_PIXEL_HELPURL, tooltip: Blockly.Msg.MICROBIT_DISPLAY_SET_PIXEL_TOOLTIP, message0: Blockly.Msg.MICROBIT_DISPLAY_SET_PIXEL_MESSAGE0, args0: [{ check: "Number", type: "input_value", name: "x" }, { check: "Number", type: "input_value", name: "y" }, { check: "Number", type: "input_value", name: "value" }] }) } }; Blockly.Blocks.microbit_display_clear = { init: function () { this.jsonInit({ colour: 96, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_DISPLAY_CLEAR_HELPURL, tooltip: Blockly.Msg.MICROBIT_DISPLAY_CLEAR_TOOLTIP, message0: Blockly.Msg.MICROBIT_DISPLAY_CLEAR_MESSAGE0 }) } }; Blockly.Blocks.microbit_display_show_image = { init: function () { this.jsonInit({ colour: 96, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_DISPLAY_SHOW_IMAGE_HELPURL, tooltip: Blockly.Msg.MICROBIT_DISPLAY_SHOW_IMAGE_TOOLTIP, message0: Blockly.Msg.MICROBIT_DISPLAY_SHOW_IMAGE_MESSAGE0, args0: [{ check: ["microbit_image", "String"], type: "input_value", name: "image" }] }) } }; Blockly.Blocks.microbit_display_show_image_with_bri = { init: function () { this.jsonInit({ inputsInline: !0, colour: 96, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_DISPLAY_SHOW_IMAGE_HELPURL, tooltip: Blockly.Msg.MICROBIT_DISPLAY_SHOW_IMAGE_WITH_BRI_TOOLTIP, message0: Blockly.Msg.MICROBIT_DISPLAY_SHOW_IMAGE_WITH_BRI_MESSAGE0, args0: [{ check: "Number", type: "input_value", name: "bri1" }, { check: "Number", type: "input_value", name: "bri2" }, { check: ["microbit_image", "String"], type: "input_value", name: "image" }] }) } }; Blockly.Blocks.microbit_display_show_animation = { init: function () { this.jsonInit({ colour: 96, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_DISPLAY_SHOW_ANIMATION_HELPURL, tooltip: Blockly.Msg.MICROBIT_DISPLAY_SHOW_ANIMATION_TOOLTIP, message0: Blockly.Msg.MICROBIT_DISPLAY_SHOW_ANIMATION_MESSAGE0, args0: [{ check: ["Array", "String"], type: "input_value", name: "images" }, { min: 0, value: 400, type: "field_number", name: "delay" }, { type: "input_dummy" }, { checked: !0, type: "field_checkbox", name: "wait" }, { type: "input_dummy" }, { checked: !1, type: "field_checkbox", name: "loop" }, { type: "input_dummy" }, { checked: !1, type: "field_checkbox", name: "clear" }] }) } }; Blockly.Blocks.microbit_display_scroll = { init: function () { this.jsonInit({ colour: 96, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_DISPLAY_SCROLL_HELPURL, tooltip: Blockly.Msg.MICROBIT_DISPLAY_SCROLL_TOOLTIP, message0: Blockly.Msg.MICROBIT_DISPLAY_SCROLL_MESSAGE0, args0: [{ check: "String", type: "input_value", name: "message" }] }) } }; Blockly.Blocks.microbit_display_scroll_animation = { init: function () { this.jsonInit({ colour: 96, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_DISPLAY_SCROLL_ANIMATION_HELPURL, tooltip: Blockly.Msg.MICROBIT_DISPLAY_SCROLL_ANIMATION_TOOLTIP, message0: Blockly.Msg.MICROBIT_DISPLAY_SCROLL_ANIMATION_MESSAGE0, args0: [{ check: "String", type: "input_value", name: "message" }, { min: 0, value: 150, type: "field_number", name: "delay" }, { type: "input_dummy" }, { checked: !0, type: "field_checkbox", name: "wait" }, { type: "input_dummy" }, { checked: !1, type: "field_checkbox", name: "loop" }, { type: "input_dummy" }, { checked: !0, type: "field_checkbox", name: "monospace" }] }) } }; Blockly.Blocks.microbit_display_on = { init: function () { this.jsonInit({ colour: 96, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_DISPLAY_ON_HELPURL, tooltip: Blockly.Msg.MICROBIT_DISPLAY_ON_TOOLTIP, message0: Blockly.Msg.MICROBIT_DISPLAY_ON_MESSAGE0 }) } }; Blockly.Blocks.microbit_display_off = { init: function () { this.jsonInit({ colour: 96, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_DISPLAY_OFF_HELPURL, tooltip: Blockly.Msg.MICROBIT_DISPLAY_OFF_TOOLTIP, message0: Blockly.Msg.MICROBIT_DISPLAY_OFF_MESSAGE0 }) } }; Blockly.Blocks.microbit_display_is_on = { init: function () { this.jsonInit({ colour: 96, output: "Boolean", helpUrl: Blockly.Msg.MICROBIT_DISPLAY_IS_ON_HELPURL, tooltip: Blockly.Msg.MICROBIT_DISPLAY_IS_ON_TOOLTIP, message0: Blockly.Msg.MICROBIT_DISPLAY_IS_ON_MESSAGE0 }) } }; Blockly.Blocks.microbit_image_builtins = { init: function () { this.jsonInit({ colour: 128, args0: [{ name: "image", options: [[Blockly.Msg.MICROBIT_IMAGE_HEART, "HEART"], [Blockly.Msg.MICROBIT_IMAGE_HEART_SMALL, "HEART_SMALL"], [Blockly.Msg.MICROBIT_IMAGE_HAPPY, "HAPPY"], [Blockly.Msg.MICROBIT_IMAGE_SMILE, "SMILE"], [Blockly.Msg.MICROBIT_IMAGE_SAD, "SAD"], [Blockly.Msg.MICROBIT_IMAGE_CONFUSED, "CONFUSED"], [Blockly.Msg.MICROBIT_IMAGE_ANGRY, "ANGRY"], [Blockly.Msg.MICROBIT_IMAGE_ASLEEP, "ASLEEP"], [Blockly.Msg.MICROBIT_IMAGE_SUPRISED, "SURPRISED"], [Blockly.Msg.MICROBIT_IMAGE_SILLY, "SILLY"], [Blockly.Msg.MICROBIT_IMAGE_FABULOUS, "FABULOUS"], [Blockly.Msg.MICROBIT_IMAGE_MEH, "MEH"], [Blockly.Msg.MICROBIT_IMAGE_YES, "YES"], [Blockly.Msg.MICROBIT_IMAGE_NO, "NO"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK12, "CLOCK12"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK11, "CLOCK11"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK10, "CLOCK10"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK9, "CLOCK9"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK8, "CLOCK8"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK7, "CLOCK7"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK6, "CLOCK6"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK5, "CLOCK5"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK4, "CLOCK4"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK3, "CLOCK3"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK2, "CLOCK2"], [Blockly.Msg.MICROBIT_IMAGE_CLOCK1, "CLOCK1"], [Blockly.Msg.MICROBIT_IMAGE_ARROW_N, "ARROW_N"], [Blockly.Msg.MICROBIT_IMAGE_ARROW_NE, "ARROW_NE"], [Blockly.Msg.MICROBIT_IMAGE_ARROW_E, "ARROW_E"], [Blockly.Msg.MICROBIT_IMAGE_ARROW_SE, "ARROW_SE"], [Blockly.Msg.MICROBIT_IMAGE_ARROW_S, "ARROW_S"], [Blockly.Msg.MICROBIT_IMAGE_ARROW_SW, "ARROW_SW"], [Blockly.Msg.MICROBIT_IMAGE_ARROW_W, "ARROW_W"], [Blockly.Msg.MICROBIT_IMAGE_ARROW_NW, "ARROW_NW"], [Blockly.Msg.MICROBIT_IMAGE_TRIANGLE, "TRIANGLE"], [Blockly.Msg.MICROBIT_IMAGE_TRIANGLE_LEFT, "TRIANGLE_LEFT"], [Blockly.Msg.MICROBIT_IMAGE_CHESSBOARD, "CHESSBOARD"], [Blockly.Msg.MICROBIT_IMAGE_DIAMOND, "DIAMOND"], [Blockly.Msg.MICROBIT_IMAGE_DIAMOND_SMALL, "DIAMOND_SMALL"], [Blockly.Msg.MICROBIT_IMAGE_SQUARE, "SQUARE"], [Blockly.Msg.MICROBIT_IMAGE_SQUARE_SMALL, "SQUARE_SMALL"], [Blockly.Msg.MICROBIT_IMAGE_RABBIT, "RABBIT"], [Blockly.Msg.MICROBIT_IMAGE_COW, "COW"], [Blockly.Msg.MICROBIT_IMAGE_MUSIC_CROTCHET, "MUSIC_CROTCHET"], [Blockly.Msg.MICROBIT_IMAGE_MUSIC_QUAVER, "MUSIC_QUAVER"], [Blockly.Msg.MICROBIT_IMAGE_MUSIC_QUAVERS, "MUSIC_QUAVERS"], [Blockly.Msg.MICROBIT_IMAGE_PITCHFORK, "PITCHFORK"], [Blockly.Msg.MICROBIT_IMAGE_XMAS, "XMAS"], [Blockly.Msg.MICROBIT_IMAGE_PACMAN, "PACMAN"], [Blockly.Msg.MICROBIT_IMAGE_TARGET, "TARGET"], [Blockly.Msg.MICROBIT_IMAGE_TSHIRT, "TSHIRT"], [Blockly.Msg.MICROBIT_IMAGE_ROLLERSKATE, "ROLLERSKATE"], [Blockly.Msg.MICROBIT_IMAGE_DUCK, "DUCK"], [Blockly.Msg.MICROBIT_IMAGE_HOUSE, "HOUSE"], [Blockly.Msg.MICROBIT_IMAGE_TORTOISE, "TORTOISE"], [Blockly.Msg.MICROBIT_IMAGE_BUTTERFLY, "BUTTERFLY"], [Blockly.Msg.MICROBIT_IMAGE_STICKFIGURE, "STICKFIGURE"], [Blockly.Msg.MICROBIT_IMAGE_GHOST, "GHOST"], [Blockly.Msg.MICROBIT_IMAGE_SWORD, "SWORD"], [Blockly.Msg.MICROBIT_IMAGE_GIRAFFE, "GIRAFFE"], [Blockly.Msg.MICROBIT_IMAGE_SKULL, "SKULL"], [Blockly.Msg.MICROBIT_IMAGE_UMBRELLA, "UMBRELLA"], [Blockly.Msg.MICROBIT_IMAGE_SNAKE, "SNAKE"], [Blockly.Msg.MICROBIT_IMAGE_ALL_CLOCKS, "ALL_CLOCKS"], [Blockly.Msg.MICROBIT_IMAGE_ALL_ARROWS, "ALL_ARROWS"]], type: "field_dropdown" }], output: ["microbit_image", "Array"], helpUrl: Blockly.Msg.MICROBIT_IMAGE_BUILTINS_HELPURL, tooltip: Blockly.Msg.MICROBIT_IMAGE_BUILTINS_TOOLTIP, message0: Blockly.Msg.MICROBIT_IMAGE_BUILTINS_MESSAGE0 }) } }; Blockly.Blocks.microbit_image_copy = { init: function () { this.jsonInit({ colour: 128, args0: [{ check: "microbit_image", type: "input_value", name: "image" }], output: "microbit_image", helpUrl: Blockly.Msg.MICROBIT_IMAGE_COPY_HELPURL, tooltip: Blockly.Msg.MICROBIT_IMAGE_COPY_TOOLTIP, message0: Blockly.Msg.MICROBIT_IMAGE_COPY_MESSAGE0 }) } }; Blockly.Blocks.microbit_image_invert = { init: function () { this.jsonInit({ colour: 128, args0: [{ check: "microbit_image", type: "input_value", name: "image" }], output: "microbit_image", helpUrl: Blockly.Msg.MICROBIT_IMAGE_INVERT_HELPURL, tooltip: Blockly.Msg.MICROBIT_IMAGE_INVERT_TOOLTIP, message0: Blockly.Msg.MICROBIT_IMAGE_INVERT_MESSAGE0 }) } }; Blockly.Blocks.microbit_image_create = { init: function () { this.jsonInit({ colour: 128, args0: [{ type: "input_dummy" }, { colour: "#000000", type: "field_colour", name: "00" }, { colour: "#000000", type: "field_colour", name: "01" }, { colour: "#000000", type: "field_colour", name: "02" }, { colour: "#000000", type: "field_colour", name: "03" }, { colour: "#000000", type: "field_colour", name: "04" }, { type: "input_dummy" }, { colour: "#000000", type: "field_colour", name: "10" }, { colour: "#000000", type: "field_colour", name: "11" }, { colour: "#000000", type: "field_colour", name: "12" }, { colour: "#000000", type: "field_colour", name: "13" }, { colour: "#000000", type: "field_colour", name: "14" }, { type: "input_dummy" }, { colour: "#000000", type: "field_colour", name: "20" }, { colour: "#000000", type: "field_colour", name: "21" }, { colour: "#000000", type: "field_colour", name: "22" }, { colour: "#000000", type: "field_colour", name: "23" }, { colour: "#000000", type: "field_colour", name: "24" }, { type: "input_dummy" }, { colour: "#000000", type: "field_colour", name: "30" }, { colour: "#000000", type: "field_colour", name: "31" }, { colour: "#000000", type: "field_colour", name: "32" }, { colour: "#000000", type: "field_colour", name: "33" }, { colour: "#000000", type: "field_colour", name: "34" }, { type: "input_dummy" }, { colour: "#000000", type: "field_colour", name: "40" }, { colour: "#000000", type: "field_colour", name: "41" }, { colour: "#000000", type: "field_colour", name: "42" }, { colour: "#000000", type: "field_colour", name: "43" }, { colour: "#000000", type: "field_colour", name: "44" }], output: "microbit_image", helpUrl: Blockly.Msg.MICROBIT_IMAGE_CREATE_HELPURL, tooltip: Blockly.Msg.MICROBIT_IMAGE_CREATE_TOOLTIP, message0: Blockly.Msg.MICROBIT_IMAGE_CREATE_MESSAGE0 }) } }; Blockly.Blocks.microbit_image_create1 = { init: function () { this.jsonInit({ colour: 128, args0: [{ type: "input_dummy" }, { name: "row0", type: "input_value", check: "String" }, { name: "row1", type: "input_value", check: "String" }, { name: "row2", type: "input_value", check: "String" }, { name: "row3", type: "input_value", check: "String" }, { name: "row4", type: "input_value", check: "String" }], output: "microbit_image", helpUrl: Blockly.Msg.MICROBIT_IMAGE_CREATE1_HELPURL, tooltip: Blockly.Msg.MICROBIT_IMAGE_CREATE1_TOOLTIP, message0: Blockly.Msg.MICROBIT_IMAGE_CREATE1_MESSAGE0 }) } }; Blockly.Blocks.microbit_image_shift = { init: function () { this.jsonInit({ colour: 128, args0: [{ check: "microbit_image", type: "input_value", name: "image" }, { name: "shift", options: [[Blockly.Msg.MICROBIT_IMAGE_SHIFT_LEFT, "LEFT"], [Blockly.Msg.MICROBIT_IMAGE_SHIFT_RIGHT, "RIGHT"], [Blockly.Msg.MICROBIT_IMAGE_SHIFT_UP, "UP"], [Blockly.Msg.MICROBIT_IMAGE_SHIFT_DOWN, "DOWN"]], type: "field_dropdown" }, { check: "Number", type: "input_value", name: "pos" }], output: "microbit_image", helpUrl: Blockly.Msg.MICROBIT_IMAGE_SHIFT_HELPURL, tooltip: Blockly.Msg.MICROBIT_IMAGE_SHIFT_TOOLTIP, message0: Blockly.Msg.MICROBIT_IMAGE_SHIFT_MESSAGE0 }) } }; Blockly.Blocks.microbit_microbit_panic = { init: function () { this.jsonInit({ colour: 160, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_MICROBIT_PANIC_HELPURL, tooltip: Blockly.Msg.MICROBIT_MICROBIT_PANIC_TOOLTIP, message0: Blockly.Msg.MICROBIT_MICROBIT_PANIC_MESSAGE0, args0: [{ min: 0, value: 0, type: "field_number", max: 255, name: "code" }] }) } }; Blockly.Blocks.microbit_microbit_reset = { init: function () { this.jsonInit({ colour: 160, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_MICROBIT_RESET_HELPURL, tooltip: Blockly.Msg.MICROBIT_MICROBIT_RESET_TOOLTIP, message0: Blockly.Msg.MICROBIT_MICROBIT_RESET_MESSAGE0 }) } }; Blockly.Blocks.microbit_microbit_sleep = { init: function () { this.jsonInit({ inputsInline: !0, nextStatement: null, previousStatement: null, colour: 160, helpUrl: Blockly.Msg.MICROBIT_MICROBIT_SLEEP_HELPURL, tooltip: Blockly.Msg.MICROBIT_MICROBIT_SLEEP_TOOLTIP, message0: Blockly.Msg.MICROBIT_MICROBIT_SLEEP_MESSAGE0, args0: [{ check: "Number", type: "input_value", name: "duration" }] }) } }; Blockly.Blocks.microbit_microbit_running_time = { init: function () { this.jsonInit({ colour: 160, output: "Number", helpUrl: Blockly.Msg.MICROBIT_MICROBIT_RUNNING_TIME_HELPURL, tooltip: Blockly.Msg.MICROBIT_MICROBIT_RUNNING_TIME_TOOLTIP, message0: Blockly.Msg.MICROBIT_MICROBIT_RUNNING_TIME_MESSAGE0 }) } }; Blockly.Blocks.microbit_microbit_temperature = { init: function () { this.jsonInit({ colour: 160, output: "Number", helpUrl: Blockly.Msg.MICROBIT_MICROBIT_TEMPERATURE_HELPURL, tooltip: Blockly.Msg.MICROBIT_MICROBIT_TEMPERATURE_TOOLTIP, message0: Blockly.Msg.MICROBIT_MICROBIT_TEMPERATURE_MESSAGE0 }) } }; Blockly.Blocks.microbit_music_play_built_in = { init: function () { this.jsonInit({ colour: 192, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_MUSIC_PLAY_BUILT_IN_HELPURL, tooltip: Blockly.Msg.MICROBIT_MUSIC_PLAY_BUILT_IN_TOOLTIP, message0: Blockly.Msg.MICROBIT_MUSIC_PLAY_BUILT_IN_MESSAGE0, args0: [{ name: "melody", options: [["DADADADUM", "DADADADUM"], ["ENTERTAINER", "ENTERTAINER"], ["PRELUDE", "PRELUDE"], ["ODE", "ODE"], ["NYAN", "NYAN"], ["RINGTONE", "RINGTONE"], ["FUNK", "FUNK"], ["BLUES", "BLUES"], ["BIRTHDAY", "BIRTHDAY"], ["WEDDING", "WEDDING"], ["FUNERAL", "FUNERAL"], ["PUNCHLINE", "PUNCHLINE"], ["PYTHON", "PYTHON"], ["BADDY", "BADDY"], ["CHASE", "CHASE"], ["BA_DING", "BA_DING"], ["WAWAWAWAA", "WAWAWAWAA"], ["JUMP_UP", "JUMP_UP"], ["JUMP_DOWN", "JUMP_DOWN"], ["POWER_UP", "POWER_UP"], ["POWER_DOWN", "POWER_DOWN"]], type: "field_dropdown" }, { type: "input_dummy" }, { checked: !0, type: "field_checkbox", name: "wait" }, { type: "input_dummy" }, { checked: !1, type: "field_checkbox", name: "loop" }] }) } }; Blockly.Blocks.microbit_music_pitch = { init: function () { this.jsonInit({ inputsInline: !0, nextStatement: null, previousStatement: null, colour: 192, helpUrl: Blockly.Msg.MICROBIT_MUSIC_PITCH_HELPURL, tooltip: Blockly.Msg.MICROBIT_MUSIC_PITCH_TOOLTIP, message0: Blockly.Msg.MICROBIT_MUSIC_PITCH_MESSAGE0, args0: [{ check: "Number", type: "input_value", name: "pitch" }, { type: "input_dummy" }, { check: "Number", type: "input_value", name: "duration" }] }) } }; Blockly.Blocks.microbit_music_play_list_of_notes = { init: function () { this.jsonInit({ colour: 192, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_MUSIC_PLAY_LIST_OF_NOTES_HELPURL, tooltip: Blockly.Msg.MICROBIT_MUSIC_PLAY_LIST_OF_NOTES_TOOLTIP, message0: Blockly.Msg.MICROBIT_MUSIC_PLAY_LIST_OF_NOTES_MESSAGE0, args0: [{ check: "Array", type: "input_value", name: "notes" }, { checked: !0, type: "field_checkbox", name: "wait" }, { type: "input_dummy" }, { checked: !1, type: "field_checkbox", name: "loop" }] }) } }; Blockly.Blocks.microbit_music_reset = { init: function () { this.jsonInit({ colour: 192, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_MUSIC_RESET_HELPURL, tooltip: Blockly.Msg.MICROBIT_MUSIC_RESET_TOOLTIP, message0: Blockly.Msg.MICROBIT_MUSIC_RESET_MESSAGE0 }) } }; Blockly.Blocks.microbit_music_stop = { init: function () { this.jsonInit({ colour: 192, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_MUSIC_STOP_HELPURL, tooltip: Blockly.Msg.MICROBIT_MUSIC_STOP_TOOLTIP, message0: Blockly.Msg.MICROBIT_MUSIC_STOP_MESSAGE0 }) } }; Blockly.Blocks.microbit_music_set_tempo = { init: function () { this.jsonInit({ inputsInline: !0, nextStatement: null, previousStatement: null, colour: 192, helpUrl: Blockly.Msg.MICROBIT_MUSIC_SET_TEMPO_HELPURL, tooltip: Blockly.Msg.MICROBIT_MUSIC_SET_TEMPO_TOOLTIP, message0: Blockly.Msg.MICROBIT_MUSIC_SET_TEMPO_MESSAGE0, args0: [{ check: "Number", type: "input_value", name: "ticks" }, { check: "Number", type: "input_value", name: "bpm" }] }) } }; Blockly.Blocks.microbit_music_get_tempo = { init: function () { this.jsonInit({ colour: 192, output: "Array", helpUrl: Blockly.Msg.MICROBIT_MUSIC_GET_TEMPO_HELPURL, tooltip: Blockly.Msg.MICROBIT_MUSIC_GET_TEMPO_TOOLTIP, message0: Blockly.Msg.MICROBIT_MUSIC_GET_TEMPO_MESSAGE0 }) } }; Blockly.Blocks.microbit_neopixel_initialise = { init: function () { this.jsonInit({ colour: 224, args0: [{ name: "pin", options: [["pin0", "pin0"], ["pin1", "pin1"], ["pin2", "pin2"], ["pin3", "pin3"], ["pin4", "pin4"], ["pin5", "pin5"], ["pin6", "pin6"], ["pin7", "pin7"], ["pin8", "pin8"], ["pin9", "pin9"], ["pin10", "pin10"], ["pin11", "pin11"], ["pin12", "pin12"], ["pin13", "pin13"], ["pin14", "pin14"], ["pin15", "pin15"], ["pin16", "pin16"], ["pin17", "pin17"], ["pin18", "pin18"], ["pin19", "pin19"], ["pin20", "pin20"]], type: "field_dropdown" }, { min: 1, value: 1, type: "field_number", name: "n" }], output: "neopixel_object", helpUrl: Blockly.Msg.MICROBIT_NEOPIXEL_INITIALISE_HELPURL, tooltip: Blockly.Msg.MICROBIT_NEOPIXEL_INITIALISE_TOOLTIP, message0: Blockly.Msg.MICROBIT_NEOPIXEL_INITIALISE_MESSAGE0 }) } }; Blockly.Blocks.microbit_neopixel_clear = { init: function () { this.jsonInit({ colour: 224, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_NEOPIXEL_CLEAR_HELPURL, tooltip: Blockly.Msg.MICROBIT_NEOPIXEL_CLEAR_TOOLTIP, message0: Blockly.Msg.MICROBIT_NEOPIXEL_CLEAR_MESSAGE0, args0: [{ check: "neopixel_object", type: "input_value", name: "neopixel_object" }] }) } }; Blockly.Blocks.microbit_neopixel_show = { init: function () { this.jsonInit({ colour: 224, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_NEOPIXEL_SHOW_HELPURL, tooltip: Blockly.Msg.MICROBIT_NEOPIXEL_SHOW_TOOLTIP, message0: Blockly.Msg.MICROBIT_NEOPIXEL_SHOW_MESSAGE0, args0: [{ check: "neopixel_object", type: "input_value", name: "neopixel_object" }] }) } }; Blockly.Blocks.microbit_neopixel_set = { init: function () { this.jsonInit({ inputsInline: !1, nextStatement: null, previousStatement: null, colour: 224, helpUrl: Blockly.Msg.MICROBIT_NEOPIXEL_SET_HELPURL, tooltip: Blockly.Msg.MICROBIT_NEOPIXEL_SET_TOOLTIP, message0: Blockly.Msg.MICROBIT_NEOPIXEL_SET_MESSAGE0, args0: [{ check: "neopixel_object", type: "input_value", name: "neopixel_object" }, { check: "Number", type: "input_value", name: "pixel" }, { check: "Number", type: "input_value", name: "red" }, { check: "Number", type: "input_value", name: "green" }, { check: "Number", type: "input_value", name: "blue" }] }) } }; Blockly.Blocks.microbit_pin_touched = { init: function () { this.jsonInit({ colour: 256, args0: [{ name: "pin", options: [["0", "0"], ["1", "1"], ["2", "2"]], type: "field_dropdown" }], output: "Boolean", helpUrl: Blockly.Msg.MICROBIT_PIN_TOUCHED_HELPURL, tooltip: Blockly.Msg.MICROBIT_PIN_TOUCHED_TOOLTIP, message0: Blockly.Msg.MICROBIT_PIN_TOUCHED_MESSAGE0 }) } }; Blockly.Blocks.microbit_pin_was_pressed = { init: function () { this.jsonInit({ colour: 256, args0: [{ name: "pin", options: [["0", "0"], ["1", "1"], ["2", "2"]], type: "field_dropdown" }], output: "Boolean", helpUrl: Blockly.Msg.MICROBIT_PIN_WAS_PRESSED_HELPURL, tooltip: Blockly.Msg.MICROBIT_PIN_WAS_PRESSED_TOOLTIP, message0: Blockly.Msg.MICROBIT_PIN_WAS_PRESSED_MESSAGE0 }) } }; Blockly.Blocks.microbit_pin_get_presses = { init: function () { this.jsonInit({ colour: 256, args0: [{ name: "pin", options: [["0", "0"], ["1", "1"], ["2", "2"]], type: "field_dropdown" }], output: "Boolean", helpUrl: Blockly.Msg.MICROBIT_PIN_GET_PRESSES_HELPURL, tooltip: Blockly.Msg.MICROBIT_PIN_GET_PRESSES_TOOLTIP, message0: Blockly.Msg.MICROBIT_PIN_GET_PRESSES_MESSAGE0 }) } }; Blockly.Blocks.microbit_pin_read_analog = { init: function () { this.jsonInit({ colour: 256, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Number", helpUrl: Blockly.Msg.MICROBIT_PIN_READ_ANALOG_HELPURL, tooltip: Blockly.Msg.MICROBIT_PIN_READ_ANALOG_TOOLTIP, message0: Blockly.Msg.MICROBIT_PIN_READ_ANALOG_MESSAGE0 }) } }; Blockly.Blocks.microbit_pin_write_analog = { init: function () { this.jsonInit({ inputsInline: !0, colour: 256, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_PIN_WRITE_ANALOG_HELPURL, tooltip: Blockly.Msg.MICROBIT_PIN_WRITE_ANALOG_TOOLTIP, message0: Blockly.Msg.MICROBIT_PIN_WRITE_ANALOG_MESSAGE0, args0: [{ check: "Number", type: "input_value", name: "output" }, { name: "pin", type: "input_value", check: "Number" }] }) } }; Blockly.Blocks.microbit_pin_read_digital = { init: function () { this.jsonInit({ colour: 256, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Boolean", helpUrl: Blockly.Msg.MICROBIT_PIN_READ_DIGITAL_HELPURL, tooltip: Blockly.Msg.MICROBIT_PIN_READ_DIGITAL_TOOLTIP, message0: Blockly.Msg.MICROBIT_PIN_READ_DIGITAL_MESSAGE0 }) } }; Blockly.Blocks.microbit_pin_write_digital = { init: function () { this.jsonInit({ inputsInline: !0, colour: 256, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_PIN_WRITE_DIGITAL_HELPURL, tooltip: Blockly.Msg.MICROBIT_PIN_WRITE_DIGITAL_TOOLTIP, message0: Blockly.Msg.MICROBIT_PIN_WRITE_DIGITAL_MESSAGE0, args0: [{ check: "Number", type: "input_value", name: "output" }, { name: "pin", type: "input_value", check: "Number" }] }) } }; Blockly.Blocks.microbit_pin_set_servo = { init: function () { this.jsonInit({ inputsInline: !0, colour: 256, args0: [{ name: "pin", type: "input_value", check: "Number" }, { name: "degree", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.MICROBIT_PIN_SET_SERVO_HELPURL, tooltip: Blockly.Msg.MICROBIT_PIN_SET_SERVO_TOOLTIP, message0: Blockly.Msg.MICROBIT_PIN_SET_SERVO_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.microbit_pin_set_mode = { init: function () { this.jsonInit({ inputsInline: !0, colour: 256, args0: [{ name: "pin", type: "input_value", check: "Number" }, { name: "mode", options: [[Blockly.Msg.MICROBIT_PIN_MODE_NO, "NO"], [Blockly.Msg.MICROBIT_PIN_MODE_UP, "UP"], [Blockly.Msg.MICROBIT_PIN_MODE_DOWN, "DOWN"]], type: "field_dropdown" }], helpUrl: Blockly.Msg.MICROBIT_PIN_SET_MODE_HELPURL, tooltip: Blockly.Msg.MICROBIT_PIN_SET_MODE_TOOLTIP, message0: Blockly.Msg.MICROBIT_PIN_SET_MODE_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.microbit_radio_on = { init: function () { this.jsonInit({ colour: 288, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_RADIO_ON_HELPURL, tooltip: Blockly.Msg.MICROBIT_RADIO_ON_TOOLTIP, message0: Blockly.Msg.MICROBIT_RADIO_ON_MESSAGE0 }) } }; Blockly.Blocks.microbit_radio_off = { init: function () { this.jsonInit({ colour: 288, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_RADIO_OFF_HELPURL, tooltip: Blockly.Msg.MICROBIT_RADIO_OFF_TOOLTIP, message0: Blockly.Msg.MICROBIT_RADIO_OFF_MESSAGE0 }) } }; Blockly.Blocks.microbit_radio_config = { init: function () { this.jsonInit({ colour: 288, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_RADIO_CONFIG_HELPURL, tooltip: Blockly.Msg.MICROBIT_RADIO_CONFIG_TOOLTIP, message0: Blockly.Msg.MICROBIT_RADIO_CONFIG_MESSAGE0, args0: [{ min: 4, value: 32, type: "field_number", max: 251, name: "length" }, { type: "input_dummy" }, { min: 1, value: 3, type: "field_number", max: 32, name: "queue" }, { type: "input_dummy" }, { min: 0, value: 7, type: "field_number", max: 100, name: "channel" }, { type: "input_dummy" }, { min: 0, value: 0, type: "field_number", max: 7, name: "power" }, { type: "input_dummy" }, { text: "0x75626974", type: "field_input", name: "address" }, { type: "input_dummy" }, { min: 0, value: 0, type: "field_number", max: 255, name: "group" }, { type: "input_dummy" }, { name: "data_rate", options: [["1Mbit", "RATE_1MBIT"], ["250Kbit", "RATE_250KBIT"], ["2Mbit", "RATE_2MBIT"]], type: "field_dropdown" }] }) } }; Blockly.Blocks.microbit_radio_reset = { init: function () { this.jsonInit({ colour: 288, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_RADIO_RESET_HELPURL, tooltip: Blockly.Msg.MICROBIT_RADIO_RESET_TOOLTIP, message0: Blockly.Msg.MICROBIT_RADIO_RESET_MESSAGE0 }) } }; Blockly.Blocks.microbit_radio_send_string = { init: function () { this.jsonInit({ colour: 288, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_RADIO_SEND_STRING_HELPURL, tooltip: Blockly.Msg.MICROBIT_RADIO_SEND_STRING_TOOLTIP, message0: Blockly.Msg.MICROBIT_RADIO_SEND_STRING_MESSAGE0, args0: [{ check: "String", type: "input_value", name: "message" }] }) } }; Blockly.Blocks.microbit_radio_send_bytes = { init: function () { this.jsonInit({ colour: 288, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_RADIO_SEND_BYTES_HELPURL, tooltip: Blockly.Msg.MICROBIT_RADIO_SEND_BYTES_TOOLTIP, message0: Blockly.Msg.MICROBIT_RADIO_SEND_BYTES_MESSAGE0, args0: [{ check: "Array", type: "input_value", name: "message" }] }) } }; Blockly.Blocks.microbit_radio_receive = { init: function () { this.jsonInit({ colour: 288, output: "String", helpUrl: Blockly.Msg.MICROBIT_RADIO_RECEIVE_HELPURL, tooltip: Blockly.Msg.MICROBIT_RADIO_RECEIVE_TOOLTIP, message0: Blockly.Msg.MICROBIT_RADIO_RECEIVE_MESSAGE0 }) } }; Blockly.Blocks.microbit_radio_receive_bytes = { init: function () { this.jsonInit({ colour: 288, output: "Array", helpUrl: Blockly.Msg.MICROBIT_RADIO_RECEIVE_BYTES_HELPURL, tooltip: Blockly.Msg.MICROBIT_RADIO_RECEIVE_BYTES_TOOLTIP, message0: Blockly.Msg.MICROBIT_RADIO_RECEIVE_BYTES_MESSAGE0 }) } }; Blockly.Blocks.microbit_speech_say = { init: function () { this.jsonInit({ colour: 320, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_SPEECH_SAY_HELPURL, tooltip: Blockly.Msg.MICROBIT_SPEECH_SAY_TOOLTIP, message0: Blockly.Msg.MICROBIT_SPEECH_SAY_MESSAGE0, args0: [{ check: "String", type: "input_value", name: "english" }] }) } }; Blockly.Blocks.microbit_speech_pronounce = { init: function () { this.jsonInit({ colour: 320, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_SPEECH_PRONOUNCE_HELPURL, tooltip: Blockly.Msg.MICROBIT_SPEECH_PRONOUNCE_TOOLTIP, message0: Blockly.Msg.MICROBIT_SPEECH_PRONOUNCE_MESSAGE0, args0: [{ check: "String", type: "input_value", name: "phonemes" }] }) } }; Blockly.Blocks.microbit_speech_sing = { init: function () { this.jsonInit({ colour: 320, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_SPEECH_SING_HELPURL, tooltip: Blockly.Msg.MICROBIT_SPEECH_SING_TOOLTIP, message0: Blockly.Msg.MICROBIT_SPEECH_SING_MESSAGE0, args0: [{ check: "String", type: "input_value", name: "song" }] }) } }; Blockly.Blocks.microbit_set_music_pin = { init: function () { this.jsonInit({ colour: 192, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_SET_MUSIC_PIN_HELPURL, tooltip: Blockly.Msg.MICROBIT_SET_MUSIC_PIN_TOOLTIP, message0: Blockly.Msg.MICROBIT_SET_MUSIC_PIN_MESSAGE0, args0: [{ name: "pin", type: "input_value", check: "Number" }] }) } }; Blockly.Blocks.microbit_init_i2c = { init: function () { this.jsonInit({ colour: 160, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_INIT_I2C_HELPURL, tooltip: Blockly.Msg.MICROBIT_INIT_I2C_TOOLTIP, message0: Blockly.Msg.MICROBIT_INIT_I2C_MESSAGE0, args0: [{ name: "fqs", type: "input_value", check: "Number" }, { name: "sda", type: "input_value", check: "Number" }, { name: "scl", type: "input_value", check: "Number" }] }) } }; Blockly.Blocks.microbit_i2c_read = { init: function () { this.jsonInit({ colour: 160, output: "Array", helpUrl: Blockly.Msg.MICROBIT_I2C_READ_HELPURL, tooltip: Blockly.Msg.MICROBIT_I2C_READ_TOOLTIP, message0: Blockly.Msg.MICROBIT_I2C_READ_MESSAGE0, args0: [{ name: "addr", type: "input_value", check: "Number" }, { name: "bytes", type: "input_value", check: "Number" }] }) } }; Blockly.Blocks.microbit_i2c_write = { init: function () { this.jsonInit({ colour: 160, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_I2C_WRITE_HELPURL, tooltip: Blockly.Msg.MICROBIT_I2C_WRITE_TOOLTIP, message0: Blockly.Msg.MICROBIT_I2C_WRITE_MESSAGE0, args0: [{ name: "addr", type: "input_value", check: "Number" }, { name: "buf", type: "input_value", check: "Array" }] }) } }; Blockly.Blocks.microbit_convert_bytearray = { init: function () { this.jsonInit({ colour: 160, output: "Array", helpUrl: Blockly.Msg.MICROBIT_CONVERT_BYTEARRAY_HELPURL, tooltip: Blockly.Msg.MICROBIT_CONVERT_BYTEARRAY_TOOLTIP, message0: Blockly.Msg.MICROBIT_CONVERT_BYTEARRAY_MESSAGE0, args0: [{ name: "arr", type: "input_value", check: null }] }) } }; Blockly.Blocks.microbit_uart_init = { init: function () { this.jsonInit({ colour: 160, args0: [{ name: "tx", check: "Number", type: "input_value" }, { name: "rx", check: "Number", type: "input_value" }, { name: "baudrate", check: "Number", type: "input_value" }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_UART_INIT_HELPURL, tooltip: Blockly.Msg.MICROBIT_UART_INIT_TOOLTIP, message0: Blockly.Msg.MICROBIT_UART_INIT_MESSAGE0 }) } }; Blockly.Blocks.microbit_uart_any_msg_received = { init: function () { this.jsonInit({ colour: 160, helpUrl: Blockly.Msg.MICROBIT_UART_ANY_MSG_RECEIVED_HELPURL, tooltip: Blockly.Msg.MICROBIT_UART_ANY_MSG_RECEIVED_TOOLTIP, message0: Blockly.Msg.MICROBIT_UART_ANY_MSG_RECEIVED_MESSAGE0, output: "Boolean" }) } }; Blockly.Blocks.microbit_uart_msg_type = { init: function () { this.jsonInit({ colour: 160, args0: [{ name: "type0", options: [[Blockly.Msg.MICROBIT_ALL_BYTES, "readall"], [Blockly.Msg.MICROBIT_ALINE_BYTES, "readline"], ["1", "1"], ["2", "2"], ["4", "4"]], type: "field_dropdown" }], helpUrl: "", tooltip: "", message0: "%1", output: ["Number", "String"] }) } }; Blockly.Blocks.microbit_uart_msg_type1 = { init: function () { this.jsonInit({ colour: 160, args0: [{ name: "type0", options: [[Blockly.Msg.MICROBIT_ALL_BYTES, "readall"], ["1", "1"], ["2", "2"], ["4", "4"]], type: "field_dropdown" }], helpUrl: "", tooltip: "", message0: "%1", output: ["Number", "String"] }) } }; Blockly.Blocks.microbit_uart_read_msg = { init: function () { this.jsonInit({ colour: 160, args0: [{ name: "type0", type: "input_value" }], helpUrl: Blockly.Msg.MICROBIT_UART_READ_MSG_HELPURL, tooltip: Blockly.Msg.MICROBIT_UART_READ_MSG_TOOLTIP, message0: Blockly.Msg.MICROBIT_UART_READ_MSG_MESSAGE0, output: ["Number", "String"] }) } }; Blockly.Blocks.microbit_uart_read_msg_to = { init: function () { this.jsonInit({ colour: 160, args0: [{ name: "type0", type: "input_value" }, { name: "buf0", type: "input_value" }], helpUrl: Blockly.Msg.MICROBIT_UART_READ_MSG_TO_HELPURL, tooltip: Blockly.Msg.MICROBIT_UART_READ_MSG_TO_TOOLTIP, message0: Blockly.Msg.MICROBIT_UART_READ_MSG_TO_MESSAGE0, inputsInline: !0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.microbit_uart_write_msg = { init: function () { this.jsonInit({ colour: 160, args0: [{ type: "input_value", name: "msg0", check: ["Array", "String"] }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.MICROBIT_UART_WRITE_MSG_HELPURL, tooltip: Blockly.Msg.MICROBIT_UART_WRITE_MSG_TOOLTIP, message0: Blockly.Msg.MICROBIT_UART_WRITE_MSG_MESSAGE0 }) } }; Blockly.Blocks.CocoRobo_custom_code = { init: function () { this.jsonInit({ inputsInline: !1, nextStatement: null, previousStatement: null, colour: CategoryColors.Text, helpUrl: Blockly.Msg.CocoRobo_CUSTOM_CODE_HELPURL, tooltip: Blockly.Msg.CocoRobo_CUSTOM_CODE_TOOLTIP, message0: Blockly.Msg.CocoRobo_CUSTOM_CODE_MESSAGE0, args0: [{ name: "custom_type", options: [[Blockly.Msg.CocoRobo_CUSTOM_TYPE_NORMAL, "normal"], [Blockly.Msg.CocoRobo_CUSTOM_TYPE_IMPORT, "topping"]], type: "field_dropdown" }, { type: "input_dummy" }, { type: "field_textarea", name: "custom_code", text: "custom code" }] }) } }; Blockly.Blocks.CocoRobo_print_to_chart = { init: function () { this.setColour(CategoryColors.Math); this.itemCount_ = 1; this.updateShape_(); this.setNextStatement(!0); this.setPreviousStatement(!0); this.setMutator(new Blockly.Mutator(["CocoRobo_print_to_chart_item"])); this.setTooltip(Blockly.Msg.CocoRobo_PRINT_TO_CHART_TOOLTIP) }, mutationToDom: function () { var a = document.createElement("mutation"); a.setAttribute("items", this.itemCount_); return a }, domToMutation: function (a) { this.itemCount_ = parseInt(a.getAttribute("items"), 10); this.updateShape_() }, decompose: function (a) { var b = a.newBlock("CocoRobo_print_to_chart_container"); b.initSvg(); for (var c = b.getInput("STACK").connection, e = 0; e < this.itemCount_; e++) { var d = a.newBlock("CocoRobo_print_to_chart_item"); d.initSvg(); c.connect(d.previousConnection); c = d.nextConnection } return b }, compose: function (a) { var b = a.getInputTargetBlock("STACK"); for (a = []; b;) a.push(b.valueConnection_), b = b.nextConnection && b.nextConnection.targetBlock(); for (b = 0; b < this.itemCount_; b++) { var c = this.getInput("ADD" + b).connection.targetConnection; c && -1 == a.indexOf(c) && c.disconnect() } this.itemCount_ = a.length; 4 < this.itemCount_ && (this.itemCount_ = 4); this.updateShape_(); for (b = 0; b < this.itemCount_; b++) Blockly.Mutator.reconnect(a[b], this, "ADD" + b) }, saveConnections: function (a) { a = a.getInputTargetBlock("STACK"); for (var b = 0; a;) { var c = this.getInput("ADD" + b); a.valueConnection_ = c && c.connection.targetConnection; b++; a = a.nextConnection && a.nextConnection.targetBlock() } }, updateShape_: function () { this.itemCount_ && this.getInput("EMPTY") ? this.removeInput("EMPTY") : this.itemCount_ || this.getInput("EMPTY") || this.appendDummyInput("EMPTY").appendField(Blockly.Msg.CocoRobo_PRINT_TO_CHART_EMPTY_TITLE); for (var a = 0; a < this.itemCount_; a++) if (!this.getInput("ADD" + a)) { var b = this.appendValueInput("ADD" + a); 0 == a && b.setCheck("Number").appendField(Blockly.Msg.CocoRobo_PRINT_TO_CHART_INPUT_WITH) } for (; this.getInput("ADD" + a);) this.removeInput("ADD" + a), a++ } }; Blockly.Blocks.CocoRobo_print_to_chart_item = { init: function () { this.setColour(CategoryColors.Math); this.appendDummyInput().appendField(Blockly.Msg.CocoRobo_PRINT_TO_CHART_ITEM_TITLE); this.setPreviousStatement(!0); this.setNextStatement(!0); this.setTooltip(Blockly.Msg.CocoRobo_PRINT_TO_CHART_ITEM_TOOLTIP); this.contextMenu = !1 } }; Blockly.Blocks.CocoRobo_print_to_chart_container = { init: function () { this.setColour(CategoryColors.Math); this.appendDummyInput().appendField(Blockly.Msg.CocoRobo_PRINT_TO_CHART_CONTAINER_TITLE_ADD); this.appendStatementInput("STACK"); this.setTooltip(Blockly.Msg.CocoRobo_PRINT_TO_CHART_CONTAINER_TOOLTIP); this.contextMenu = !1 } }; Blockly.Blocks.CocoRobo_init_chart = { init: function () { this.setColour(CategoryColors.Math); this.itemCount_ = 1; this.updateShape_(); this.setNextStatement(!0); this.setPreviousStatement(!0); this.setMutator(new Blockly.Mutator(["CocoRobo_init_chart_item"])); this.setTooltip(Blockly.Msg.CocoRobo_INIT_CHART_TOOLTIP) }, mutationToDom: function () { var a = document.createElement("mutation"); a.setAttribute("items", this.itemCount_); return a }, domToMutation: function (a) { this.itemCount_ = parseInt(a.getAttribute("items"), 10); this.updateShape_() }, decompose: function (a) { var b = a.newBlock("CocoRobo_init_chart_container"); b.initSvg(); for (var c = b.getInput("STACK").connection, e = 0; e < this.itemCount_; e++) { var d = a.newBlock("CocoRobo_init_chart_item"); d.initSvg(); c.connect(d.previousConnection); c = d.nextConnection } return b }, compose: function (a) { var b = a.getInputTargetBlock("STACK"); for (a = []; b;) a.push(b.valueConnection_), b = b.nextConnection && b.nextConnection.targetBlock(); for (b = 0; b < this.itemCount_; b++) { var c = this.getInput("ADD" + b).connection.targetConnection; c && -1 == a.indexOf(c) && c.disconnect() } this.itemCount_ = a.length; 4 < this.itemCount_ && (this.itemCount_ = 4); this.updateShape_(); for (b = 0; b < this.itemCount_; b++) Blockly.Mutator.reconnect(a[b], this, "ADD" + b) }, saveConnections: function (a) { a = a.getInputTargetBlock("STACK"); for (var b = 0; a;) { var c = this.getInput("ADD" + b); a.valueConnection_ = c && c.connection.targetConnection; b++; a = a.nextConnection && a.nextConnection.targetBlock() } }, updateShape_: function () { this.itemCount_ && this.getInput("EMPTY") ? this.removeInput("EMPTY") : this.itemCount_ || this.getInput("EMPTY") || this.appendDummyInput("EMPTY").appendField(Blockly.Msg.CocoRobo_INIT_CHART_EMPTY_TITLE); for (var a = 0; a < this.itemCount_; a++) if (!this.getInput("ADD" + a)) { var b = this.appendValueInput("ADD" + a); 0 == a && b.setCheck("String").appendField(Blockly.Msg.CocoRobo_INIT_CHART_INPUT_WITH) } for (; this.getInput("ADD" + a);) this.removeInput("ADD" + a), a++ } }; Blockly.Blocks.CocoRobo_init_chart_item = { init: function () { this.setColour(CategoryColors.Math); this.appendDummyInput().appendField(Blockly.Msg.CocoRobo_INIT_CHART_ITEM_TITLE); this.setPreviousStatement(!0); this.setNextStatement(!0); this.setTooltip(Blockly.Msg.CocoRobo_INIT_CHART_ITEM_TOOLTIP); this.contextMenu = !1 } }; Blockly.Blocks.CocoRobo_init_chart_container = { init: function () { this.setColour(CategoryColors.Math); this.appendDummyInput().appendField(Blockly.Msg.CocoRobo_INIT_CHART_CONTAINER_TITLE_ADD); this.appendStatementInput("STACK"); this.setTooltip(Blockly.Msg.CocoRobo_INIT_CHART_CONTAINER_TOOLTIP); this.contextMenu = !1 } }; var labplus_gpi = [["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"], ["8", "8"], ["9", "9"], ["10", "10"], ["11", "11"], ["12", "12"], ["13", "13"], ["14", "14"], ["15", "15"], ["16", "16"], ["19", "19"], ["20", "20"]] , analogPins = [["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["10", "10"]] , digitalOutput = [["0", "0"], ["1", "1"]] , extendedPins = [["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"]] , labplus_pin_pair = [["6 \x26 7", "6 \x26 7"], ["8 \x26 9", "8 \x26 9"], ["0 \x26 1", "0 \x26 1"], ["13 \x26 14", "13 \x26 14"], ["15 \x26 16", "15 \x26 16"]] , labplus_color = "#336699" , bluebitdigital = "#2E8B57" , bluebitanalog = "#00008B" , bluebiti2c = "#CDAD00"; Blockly.Blocks.labplus_digital_output = { init: function () { this.jsonInit({ colour: 320, args0: [{ name: "outputSt", options: digitalOutput, type: "field_dropdown" }], output: "Number", message0: "%1" }) } }; Blockly.Blocks.labplus_extended_pins = { init: function () { this.jsonInit({ colour: 320, args0: [{ name: "pin", options: extendedPins, type: "field_dropdown" }], output: "Number", message0: "%1" }) } }; Blockly.Blocks.labplus_labplus_gpi = { init: function () { this.jsonInit({ colour: 320, args0: [{ name: "pin", options: labplus_gpi, type: "field_dropdown" }], output: "Number", message0: "%1" }) } }; Blockly.Blocks.labplus_analog_pins = { init: function () { this.jsonInit({ colour: 320, args0: [{ name: "pin", options: analogPins, type: "field_dropdown" }], output: "Number", message0: "%1" }) } }; Blockly.Blocks.labplus_servo_output = { init: function () { this.jsonInit({ colour: 30, args0: [{ name: "num", type: "field_number", value: 90, min: 0, max: 180 }], output: "Number", message0: "%1" }) } }; Blockly.Blocks.labplus_analog_output = { init: function () { this.jsonInit({ colour: 320, args0: [{ name: "num", type: "field_number", value: 1023, min: 0, max: 1023 }], output: "Number", message0: "%1" }) } }; Blockly.Blocks.labplus_extended_pin_define = { init: function () { this.jsonInit({ colour: 320, args0: [{ name: "pin_define", options: [[Blockly.Msg.LABPLUS_COMPITITION_INIT_EXTENDED_PINS_INPUT, "0"], [Blockly.Msg.LABPLUS_COMPITITION_INIT_EXTENDED_PINS_OUTPUT, "1"]], type: "field_dropdown" }], output: "Number", message0: "%1" }) } }; Blockly.Blocks.labplus_infrared_is_triggered = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Boolean", message0: Blockly.Msg.LABPLUS_INFRARED_IS_TRIGGERED_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_INFRARED_IS_TRIGGERED_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_INFRARED_IS_TRIGGERED_HELPURL }) } }; Blockly.Blocks.labplus_sound_is_triggered = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Boolean", message0: Blockly.Msg.LABPLUS_SOUND_IS_TRIGGERED_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_SOUND_IS_TRIGGERED_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_SOUND_IS_TRIGGERED_HELPURL }) } }; Blockly.Blocks.labplus_human_detector_is_triggered = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Boolean", message0: Blockly.Msg.LABPLUS_HUMAN_DETECTOR_IS_TRIGGERED_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_HUMAN_DETECTOR_IS_TRIGGERED_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_HUMAN_DETECTOR_IS_TRIGGERED_HELPURL }) } }; Blockly.Blocks.labplus_magnetic_switch_is_triggered = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Boolean", message0: Blockly.Msg.LABPLUS_MAGNETIC_SWITCH_IS_TRIGGERED_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_MAGNETIC_SWITCH_IS_TRIGGERED_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_MAGNETIC_SWITCH_IS_TRIGGERED_HELPURL }) } }; Blockly.Blocks.labplus_line_follower_is_triggered = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Boolean", message0: Blockly.Msg.LABPLUS_LINE_FOLLOWER_IS_TRIGGERED_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_LINE_FOLLOWER_IS_TRIGGERED_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_LINE_FOLLOWER_IS_TRIGGERED_HELPURL }) } }; Blockly.Blocks.labplus_shake_detector_is_triggered = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Boolean", message0: Blockly.Msg.LABPLUS_SHAKE_DETECTOR_IS_TRIGGERED_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_SHAKE_DETECTOR_IS_TRIGGERED_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_SHAKE_DETECTOR_IS_TRIGGERED_HELPURL }) } }; Blockly.Blocks.labplus_smoke_detector_is_triggered = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Boolean", message0: Blockly.Msg.LABPLUS_SMOKE_DETECTOR_IS_TRIGGERED_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_SMOKE_DETECTOR_IS_TRIGGERED_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_SMOKE_DETECTOR_IS_TRIGGERED_HELPURL }) } }; Blockly.Blocks.labplus_fingerprint_sensor = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Boolean", message0: Blockly.Msg.LABPLUS_FINGERPRINT_SENSOR_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_FINGERPRINT_SENSOR_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_FINGERPRINT_SENSOR_HELPURL }) } }; Blockly.Blocks.labplus_get_rfid_id = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Boolean", message0: Blockly.Msg.LABPLUS_GET_RFID_ID_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_GET_RFID_ID_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_GET_RFID_ID_HELPURL }) } }; Blockly.Blocks.labplus_button_module_is_pressed = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Boolean", message0: Blockly.Msg.LABPLUS_BUTTON_MODULE_IS_PRESSED_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_BUTTON_MODULE_IS_PRESSED_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_BUTTON_MODULE_IS_PRESSED_HELPURL }) } }; Blockly.Blocks.labplus_heat_sensitive_detector = { init: function () { this.jsonInit({ colour: bluebitanalog, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Number", message0: Blockly.Msg.LABPLUS_HEAT_SENSITIVE_DETECTOR_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_HEAT_SENSITIVE_DETECTOR_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_HEAT_SENSITIVE_DETECTOR_HELPURL }) } }; Blockly.Blocks.labplus_4button = { init: function () { this.jsonInit({ colour: bluebitanalog, args0: [{ name: "pin", type: "input_value", check: "Number" }, { name: "button_val", type: "field_dropdown", options: [[Blockly.Msg.BLUE, "1"], [Blockly.Msg.GREEN, "2"], [Blockly.Msg.RED, "3"], [Blockly.Msg.YELLOW, "4"]] }], output: "Boolean", message0: Blockly.Msg.LABPLUS_4BUTTON_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_4BUTTON_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_4BUTTON_HELPURL }) } }; Blockly.Blocks.labplus_temperature_sensor = { init: function () { this.jsonInit({ colour: bluebitanalog, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Number", message0: Blockly.Msg.LABPLUS_TEMPERATURE_SENSOR_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_TEMPERATURE_SENSOR_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_TEMPERATURE_SENSOR_HELPURL }) } }; Blockly.Blocks.labplus_rotate_dimmer = { init: function () { this.jsonInit({ colour: bluebitanalog, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Number", message0: Blockly.Msg.LABPLUS_ROTATE_DIMMER_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_ROTATE_DIMMER_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_ROTATE_DIMMER_HELPURL }) } }; Blockly.Blocks.labplus_water_level_detector = { init: function () { this.jsonInit({ colour: bluebitanalog, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Number", message0: Blockly.Msg.LABPLUS_WATER_LEVEL_DETECTOR_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_WATER_LEVEL_DETECTOR_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_WATER_LEVEL_DETECTOR_HELPURL }) } }; Blockly.Blocks.labplus_sound_level_sensor = { init: function () { this.jsonInit({ colour: bluebitanalog, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Number", message0: Blockly.Msg.LABPLUS_SOUND_LEVEL_SENSOR_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_SOUND_LEVEL_SENSOR_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_SOUND_LEVEL_SENSOR_HELPURL }) } }; Blockly.Blocks.labplus_smoke_sensor = { init: function () { this.jsonInit({ colour: bluebitanalog, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Number", message0: Blockly.Msg.LABPLUS_SMOKE_SENSOR_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_SMOKE_SENSOR_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_SMOKE_SENSOR_HELPURL }) } }; Blockly.Blocks.labplus_joystick = { init: function () { this.jsonInit({ colour: bluebitanalog, args0: [{ name: "pin", type: "input_value", check: "Number" }, { name: "pin1", type: "input_value", check: "Number" }, { name: "axis", type: "field_dropdown", options: [["X", "X"], ["Y", "Y"]] }], output: "Number", message0: Blockly.Msg.LABPLUS_JOYSTICK_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_JOYSTICK_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_JOYSTICK_HELPURL }) } }; Blockly.Blocks.labplus_soil_moisture_sensor = { init: function () { this.jsonInit({ colour: bluebitanalog, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Number", message0: Blockly.Msg.LABPLUS_SOIL_MOISTURE_SENSOR_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_SOIL_MOISTURE_SENSOR_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_SOIL_MOISTURE_SENSOR_HELPURL }) } }; Blockly.Blocks.labplus_light_sensor = { init: function () { this.jsonInit({ colour: bluebitanalog, args0: [{ name: "pin", type: "input_value", check: "Number" }], output: "Number", message0: Blockly.Msg.LABPLUS_LIGHT_SENSOR_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_LIGHT_SENSOR_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_LIGHT_SENSOR_HELPURL }) } }; Blockly.Blocks.labplus_i2c_light_sensor = { init: function () { this.jsonInit({ colour: bluebiti2c, output: "Number", message0: Blockly.Msg.LABPLUS_I2C_LIGHT_SENSOR_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_I2C_LIGHT_SENSOR_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_I2C_LIGHT_SENSOR_HELPURL }) } }; Blockly.Blocks.labplus_temp_hum_sensor = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [{ name: "opt", type: "field_dropdown", options: [[Blockly.Msg.LABPLUS_TM_HM_SENSOR_TM, "temperature"], [Blockly.Msg.LABPLUS_TM_HM_SENSOR_HM, "humility"]] }], output: "Number", message0: Blockly.Msg.LABPLUS_TM_HM_SENSOR_MESSAGE0, tooltip: Blockly.Msg.LABPLUS_TM_HM_SENSOR_TOOLTIP, helpUrl: Blockly.Msg.LABPLUS_TM_HM_SENSOR_HELPURL }) } }; Blockly.Blocks.labplus_read_color_from_i2c = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [], helpUrl: Blockly.Msg.LABPLUS_READ_COLOR_FROM_I2C_HELPURL, tooltip: Blockly.Msg.LABPLUS_READ_COLOR_FROM_I2C_TOOLTIP, message0: Blockly.Msg.LABPLUS_READ_COLOR_FROM_I2C_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_rgb_color = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [{ name: "color", options: [["R", "R"], ["G", "G"], ["B", "B"]], type: "field_dropdown" }], helpUrl: Blockly.Msg.LABPLUS_RGB_COLOR_HELPURL, tooltip: Blockly.Msg.LABPLUS_RGB_COLOR_TOOLTIP, message0: Blockly.Msg.LABPLUS_RGB_COLOR_MESSAGE0, output: "Number" }) } }; Blockly.Blocks.labplus_i2c_ultrasonic = { init: function () { this.jsonInit({ colour: bluebiti2c, helpUrl: Blockly.Msg.LABPLUS_I2C_ULTRASONIC_HELPURL, tooltip: Blockly.Msg.LABPLUS_I2C_ULTRASONIC_TOOLTIP, message0: Blockly.Msg.LABPLUS_I2C_ULTRASONIC_MESSAGE0, output: "Number" }) } }; Blockly.Blocks.labplus_led = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ check: "Number", type: "input_value", name: "output" }, { name: "pin", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.LABPLUS_LED_HELPURL, tooltip: Blockly.Msg.LABPLUS_LED_TOOLTIP, message0: Blockly.Msg.LABPLUS_LED_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_fan_switch = { init: function () { this.jsonInit({ colour: bluebitdigital, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_FAN_SWITCH_HELPURL, tooltip: Blockly.Msg.LABPLUS_FAN_SWITCH_TOOLTIP, message0: Blockly.Msg.LABPLUS_FAN_SWITCH_MESSAGE0, args0: [{ type: "field_dropdown", options: [[Blockly.Msg.LABPLUS_USB_SWITCH_ON, "1"], [Blockly.Msg.LABPLUS_USB_SWITCH_OFF, "0"]], name: "status" }, { name: "pin", type: "input_value", check: "Number" }] }) } }; Blockly.Blocks.labplus_laser_switch = { init: function () { this.jsonInit({ colour: bluebitdigital, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_LASER_SWITCH_HELPURL, tooltip: Blockly.Msg.LABPLUS_LASER_SWITCH_TOOLTIP, message0: Blockly.Msg.LABPLUS_LASER_SWITCH_MESSAGE0, args0: [{ type: "field_dropdown", options: [[Blockly.Msg.LABPLUS_USB_SWITCH_ON, "1"], [Blockly.Msg.LABPLUS_USB_SWITCH_OFF, "0"]], name: "status" }, { name: "pin", type: "input_value", check: "Number" }] }) } }; Blockly.Blocks.labplus_usb_switch = { init: function () { this.jsonInit({ colour: bluebitdigital, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_USB_SWITCH_HELPURL, tooltip: Blockly.Msg.LABPLUS_USB_SWITCH_TOOLTIP, message0: Blockly.Msg.LABPLUS_USB_SWITCH_MESSAGE0, args0: [{ type: "field_dropdown", options: [[Blockly.Msg.LABPLUS_USB_SWITCH_ON, "1"], [Blockly.Msg.LABPLUS_USB_SWITCH_OFF, "0"]], name: "status" }, { name: "pin", type: "input_value", check: "Number" }] }) } }; Blockly.Blocks.labplus_voice_record_on1 = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ type: "field_dropdown", name: "func", options: [[Blockly.Msg.LABPLUS_VOICE_RECORD_PLAY, "play"], [Blockly.Msg.LABPLUS_VOICE_RECORD_REC, "rec"]] }, { type: "input_dummy" }, { type: "input_value", name: "rec", check: "Number" }, { type: "input_value", name: "play", check: "Number" }], helpUrl: Blockly.Msg.LABPLUS_VOICE_RECORD_ON1_HELPURL, tooltip: Blockly.Msg.LABPLUS_VOICE_RECORD_ON1_TOOLTIP, message0: Blockly.Msg.LABPLUS_VOICE_RECORD_ON1_MESSAGE0, nextStatement: null, previousStatement: null, inputsInline: !1 }) } }; Blockly.Blocks.labplus_voice_record_off1 = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ type: "input_dummy" }, { name: "rec", type: "input_value", check: "Number" }, { name: "play", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.LABPLUS_VOICE_RECORD_OFF1_HELPURL, tooltip: Blockly.Msg.LABPLUS_VOICE_RECORD_OFF1_TOOLTIP, message0: Blockly.Msg.LABPLUS_VOICE_RECORD_OFF1_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_set_servo = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "pin", type: "input_value", check: "Number" }, { name: "degree", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.LABPLUS_SET_SERVO_HELPURL, tooltip: Blockly.Msg.LABPLUS_SET_SERVO_TOOLTIP, message0: Blockly.Msg.LABPLUS_SET_SERVO_MESSAGE0, nextStatement: null, previousStatement: null, inputsInline: !1 }) } }; Blockly.Blocks.labplus_motor_on1 = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "status", type: "field_dropdown", options: [[Blockly.Msg.LABPLUS_MOTOR_ON_CLOCKWISE, "1"], [Blockly.Msg.LABPLUS_MOTOR_ON_ANTICLOCKWISE, "0"]] }, { name: "speed", type: "input_value", check: "Number" }, { name: "ain1", type: "input_value", check: "Number" }, { name: "ain2", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.LABPLUS_MOTOR_ON1_HELPURL, tooltip: Blockly.Msg.LABPLUS_MOTOR_ON1_TOOLTIP, message0: Blockly.Msg.LABPLUS_MOTOR_ON1_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_motor_off1 = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ type: "input_dummy" }, { name: "ain1", type: "input_value", check: "Number" }, { name: "ain2", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.LABPLUS_MOTOR_OFF1_HELPURL, tooltip: Blockly.Msg.LABPLUS_MOTOR_OFF1_TOOLTIP, message0: Blockly.Msg.LABPLUS_MOTOR_OFF1_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_set_i2c_digits = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [{ name: "val", type: "input_value", check: ["Number", "Boolean"] }], helpUrl: Blockly.Msg.LABPLUS_SET_I2C_DIGITS_HELPURL, tooltip: Blockly.Msg.LABPLUS_SET_I2C_DIGITS_TOOLTIP, message0: Blockly.Msg.LABPLUS_SET_I2C_DIGITS_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_turn_off_i2c_digits = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [], helpUrl: Blockly.Msg.LABPLUS_TURN_OFF_I2C_DIGITS_HELPURL, tooltip: Blockly.Msg.LABPLUS_TURN_OFF_I2C_DIGITS_TOOLTIP, message0: Blockly.Msg.LABPLUS_TURN_OFF_I2C_DIGITS_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_set_i2c_lcd1602_cursor = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [{ type: "input_dummy" }, { name: "xaxis", type: "input_value", check: "Number" }, { name: "yaxis", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_CURSOR_HELPURL, tooltip: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_CURSOR_TOOLTIP, message0: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_CURSOR_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_set_i2c_lcd1602_print = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [{ name: "msg0", type: "input_value", check: "String" }], helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_PRINT_HELPURL, tooltip: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_PRINT_TOOLTIP, message0: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_PRINT_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_set_i2c_lcd1602_scroll = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [{ type: "field_dropdown", name: "dir", options: [[Blockly.Msg.LABPLUS_SET_I2C_LCD1602_SCROLL_ALEFT, "aleft"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_SCROLL_RIGHTWARD, "rightward"]] }], helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_SCROLL_HELPURL, tooltip: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_SCROLL_TOOLTIP, message0: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_SCROLL_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_set_i2c_lcd1602_clear = { init: function () { this.jsonInit({ colour: bluebiti2c, helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_CLEAR_HELPURL, tooltip: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_CLEAR_TOOLTIP, message0: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_CLEAR_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_set_i2c_lcd1602_state = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [{ type: "field_dropdown", name: "action", options: [[Blockly.Msg.LABPLUS_SET_I2C_LCD1602_HIDE_CURSOR, "0x0c"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_SHOW_CURSOR, "0x0e"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_BLINK_CURSOR, "0x0d"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_SCROLL_LEFT, "0x18"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_SCROLL_RIGHT, "0x1c"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_LEFT_TO_RIGHT, "0x06"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_RIGHT_TO_LEFT, "0x04"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_CURSOR_TO_ORIGIN, "0x02"], [Blockly.Msg.LABPLUS_SET_I2C_LCD1602_CLEAR, "0x01"]] }], helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_STATE_HELPURL, tooltip: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_STATE_TOOLTIP, message0: Blockly.Msg.LABPLUS_SET_I2C_LCD1602_STATE_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_set_i2c_led_matrix2 = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [{ type: "input_dummy" }, { checked: !1, type: "field_checkbox", name: "00" }, { checked: !1, type: "field_checkbox", name: "01" }, { checked: !1, type: "field_checkbox", name: "02" }, { checked: !1, type: "field_checkbox", name: "03" }, { checked: !1, type: "field_checkbox", name: "04" }, { checked: !1, type: "field_checkbox", name: "05" }, { checked: !1, type: "field_checkbox", name: "06" }, { checked: !1, type: "field_checkbox", name: "07" }, { type: "input_dummy" }, { checked: !1, type: "field_checkbox", name: "10" }, { checked: !1, type: "field_checkbox", name: "11" }, { checked: !1, type: "field_checkbox", name: "12" }, { checked: !1, type: "field_checkbox", name: "13" }, { checked: !1, type: "field_checkbox", name: "14" }, { checked: !1, type: "field_checkbox", name: "15" }, { checked: !1, type: "field_checkbox", name: "16" }, { checked: !1, type: "field_checkbox", name: "17" }, { type: "input_dummy" }, { checked: !1, type: "field_checkbox", name: "20" }, { checked: !1, type: "field_checkbox", name: "21" }, { checked: !1, type: "field_checkbox", name: "22" }, { checked: !1, type: "field_checkbox", name: "23" }, { checked: !1, type: "field_checkbox", name: "24" }, { checked: !1, type: "field_checkbox", name: "25" }, { checked: !1, type: "field_checkbox", name: "26" }, { checked: !1, type: "field_checkbox", name: "27" }, { type: "input_dummy" }, { checked: !1, type: "field_checkbox", name: "30" }, { checked: !1, type: "field_checkbox", name: "31" }, { checked: !1, type: "field_checkbox", name: "32" }, { checked: !1, type: "field_checkbox", name: "33" }, { checked: !1, type: "field_checkbox", name: "34" }, { checked: !1, type: "field_checkbox", name: "35" }, { checked: !1, type: "field_checkbox", name: "36" }, { checked: !1, type: "field_checkbox", name: "37" }, { type: "input_dummy" }, { checked: !1, type: "field_checkbox", name: "40" }, { checked: !1, type: "field_checkbox", name: "41" }, { checked: !1, type: "field_checkbox", name: "42" }, { checked: !1, type: "field_checkbox", name: "43" }, { checked: !1, type: "field_checkbox", name: "44" }, { checked: !1, type: "field_checkbox", name: "45" }, { checked: !1, type: "field_checkbox", name: "46" }, { checked: !1, type: "field_checkbox", name: "47" }, { type: "input_dummy" }, { checked: !1, type: "field_checkbox", name: "50" }, { checked: !1, type: "field_checkbox", name: "51" }, { checked: !1, type: "field_checkbox", name: "52" }, { checked: !1, type: "field_checkbox", name: "53" }, { checked: !1, type: "field_checkbox", name: "54" }, { checked: !1, type: "field_checkbox", name: "55" }, { checked: !1, type: "field_checkbox", name: "56" }, { checked: !1, type: "field_checkbox", name: "57" }, { type: "input_dummy" }, { checked: !1, type: "field_checkbox", name: "60" }, { checked: !1, type: "field_checkbox", name: "61" }, { checked: !1, type: "field_checkbox", name: "62" }, { checked: !1, type: "field_checkbox", name: "63" }, { checked: !1, type: "field_checkbox", name: "64" }, { checked: !1, type: "field_checkbox", name: "65" }, { checked: !1, type: "field_checkbox", name: "66" }, { checked: !1, type: "field_checkbox", name: "67" }, { type: "input_dummy" }, { checked: !1, type: "field_checkbox", name: "70" }, { checked: !1, type: "field_checkbox", name: "71" }, { checked: !1, type: "field_checkbox", name: "72" }, { checked: !1, type: "field_checkbox", name: "73" }, { checked: !1, type: "field_checkbox", name: "74" }, { checked: !1, type: "field_checkbox", name: "75" }, { checked: !1, type: "field_checkbox", name: "76" }, { checked: !1, type: "field_checkbox", name: "77" }], helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_HELPURL, tooltip: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_TOOLTIP, message0: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_MESSAGE2, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_set_i2c_led_matrix = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [{ type: "input_dummy" }, { type: "input_value", name: "row1", check: "Number" }, { type: "input_value", name: "row2", check: "Number" }, { type: "input_value", name: "row3", check: "Number" }, { type: "input_value", name: "row4", check: "Number" }, { type: "input_value", name: "row5", check: "Number" }, { type: "input_value", name: "row6", check: "Number" }, { type: "input_value", name: "row7", check: "Number" }, { type: "input_value", name: "row8", check: "Number" }], helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_HELPURL, tooltip: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_TOOLTIP, message0: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_i2c_led_matrix_side = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [{ name: "side", options: [["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"]], type: "field_dropdown" }], helpUrl: "", tooltip: "", message0: "%1", output: "Number" }) } }; Blockly.Blocks.labplus_set_i2c_led_matrix_draw_pixel = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [{ type: "input_dummy" }, { type: "input_value", name: "x", check: "Number" }, { type: "input_value", name: "y", check: "Number" }], helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_DRAW_PIXEL_HELPURL, tooltip: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_DRAW_PIXEL_TOOLTIP, message0: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_DRAW_PIXEL_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_set_i2c_led_matrix_show = { init: function () { this.jsonInit({ colour: bluebiti2c, helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_SHOW_HELPURL, tooltip: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_SHOW_TOOLTIP, message0: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_SHOW_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_set_i2c_led_matrix_clear = { init: function () { this.jsonInit({ colour: bluebiti2c, helpUrl: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_CLEAR_HELPURL, tooltip: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_CLEAR_TOOLTIP, message0: Blockly.Msg.LABPLUS_SET_I2C_LED_MATRIX_CLEAR_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_uart_init_midi = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "pin", check: "Number", type: "input_value" }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_UART_INIT_MIDI_HELPURL, tooltip: Blockly.Msg.LABPLUS_UART_INIT_MIDI_TOOLTIP, message0: Blockly.Msg.LABPLUS_UART_INIT_MIDI_MESSAGE0 }) } }; var melodic = [[Blockly.Msg.JOINT_MIDI_PIANO, "1"], [Blockly.Msg.JOINT_Vibraphone, "12"], [Blockly.Msg.JOINT_MIDI_ORGAN, "17"], [Blockly.Msg.JOINT_Acoustic_Guitar, "25"], [Blockly.Msg.JOINT_Electric_Guitar, "31"], [Blockly.Msg.JOINT_Acoustic_Bass, "33"], [Blockly.Msg.JOINT_Violin, "41"], [Blockly.Msg.JOINT_String_Ensemble, "49"], [Blockly.Msg.JOINT_Trumpet, "57"], [Blockly.Msg.JOINT_Sax, "65"], [Blockly.Msg.JOINT_MIDI_BRIGHTACOUSTICPIANO, "2"], [Blockly.Msg.JOINT_MIDI_ELECTRICGRANDPIANO, "3"], [Blockly.Msg.JOINT_MIDI_HARPSICHORD, "7"], [Blockly.Msg.JOINT_MIDI_Celesta, "9"], [Blockly.Msg.JOINT_MIDI_Glockenspiel, "10"], [Blockly.Msg.JOINT_MIDI_Marimba, "13"], [Blockly.Msg.JOINT_MIDI_Xylophone, "14"], [Blockly.Msg.JOINT_MIDI_TubularBell, "15"], [Blockly.Msg.JOINT_MIDI_Dulcimer, "16"], [Blockly.Msg.JOINT_Lead, "81"], [Blockly.Msg.JOINT_Pad, "89"], [Blockly.Msg.JOINT_Steel_Drums, "115"]]; Blockly.Blocks.labplus_uart_set_midi_melodic = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "melodic", options: [[Blockly.Msg.JOINT_MIDI_PIANO, "1"], [Blockly.Msg.JOINT_Vibraphone, "12"], [Blockly.Msg.JOINT_MIDI_ORGAN, "17"], [Blockly.Msg.JOINT_Acoustic_Guitar, "25"], [Blockly.Msg.JOINT_Electric_Guitar, "31"], [Blockly.Msg.JOINT_Acoustic_Bass, "33"], [Blockly.Msg.JOINT_Violin, "41"], [Blockly.Msg.JOINT_String_Ensemble, "49"], [Blockly.Msg.JOINT_Trumpet, "57"], [Blockly.Msg.JOINT_Sax, "65"], [Blockly.Msg.JOINT_MIDI_BRIGHTACOUSTICPIANO, "2"], [Blockly.Msg.JOINT_MIDI_ELECTRICGRANDPIANO, "3"], [Blockly.Msg.JOINT_MIDI_HARPSICHORD, "7"], [Blockly.Msg.JOINT_MIDI_Celesta, "9"], [Blockly.Msg.JOINT_MIDI_Glockenspiel, "10"], [Blockly.Msg.JOINT_MIDI_Marimba, "13"], [Blockly.Msg.JOINT_MIDI_Xylophone, "14"], [Blockly.Msg.JOINT_MIDI_TubularBell, "15"], [Blockly.Msg.JOINT_MIDI_Dulcimer, "16"], [Blockly.Msg.JOINT_Lead, "81"], [Blockly.Msg.JOINT_Pad, "89"], [Blockly.Msg.JOINT_Steel_Drums, "115"]], type: "field_dropdown" }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_UART_SET_MIDI_MELODIC_HELPURL, tooltip: Blockly.Msg.LABPLUS_UART_SET_MIDI_MELODIC_TOOLTIP, message0: Blockly.Msg.LABPLUS_UART_SET_MIDI_MELODIC_MESSAGE0 }) } }; Blockly.Blocks.labplus_uart_set_midi_vol = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "volume", check: "Number", type: "input_value" }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_UART_SET_MIDI_VOL_HELPURL, tooltip: Blockly.Msg.LABPLUS_UART_SET_MIDI_VOL_TOOLTIP, message0: Blockly.Msg.LABPLUS_UART_SET_MIDI_VOL_MESSAGE0 }) } }; var note = [[Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Do, "60"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Re, "62"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Mi, "64"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Fa, "65"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Sol, "67"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_La, "69"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Si, "71"]]; Blockly.Blocks.labplus_play_buzzer_note = { init: function () { this.jsonInit({ colour: 192, args0: [{ name: "note", check: "Number", type: "input_value" }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_PLAY_BUZZER_NOTE_HELPURL, tooltip: Blockly.Msg.LABPLUS_PLAY_BUZZER_NOTE_TOOLTIP, message0: Blockly.Msg.LABPLUS_PLAY_BUZZER_NOTE_MESSAGE0 }) } }; Blockly.Blocks.labplus_uart_play_midi_note = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "note", options: [[Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Do, "60"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Re, "62"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Mi, "64"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Fa, "65"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Sol, "67"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_La, "69"], [Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_Si, "71"]], type: "field_dropdown" }, { name: "status", options: [[Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE, "1"], [Blockly.Msg.LABPLUS_UART_OFF_MIDI_NOTE, "0"]], type: "field_dropdown" }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_HELPURL, tooltip: Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_TOOLTIP, message0: Blockly.Msg.LABPLUS_UART_PLAY_MIDI_NOTE_MESSAGE0 }) } }; Blockly.Blocks.labplus_uart_mp3_play = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "index", check: "Number", type: "input_value" }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_UART_MP3_PLAY_HELPURL, tooltip: Blockly.Msg.LABPLUS_UART_MP3_PLAY_TOOLTIP, message0: Blockly.Msg.LABPLUS_UART_MP3_PLAY_MESSAGE0 }) } }; Blockly.Blocks.labplus_uart_mp3_set_volume = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "vol", check: "Number", type: "input_value" }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_UART_MP3_SET_VOLUME_HELPURL, tooltip: Blockly.Msg.LABPLUS_UART_MP3_SET_VOLUME_TOOLTIP, message0: Blockly.Msg.LABPLUS_UART_MP3_SET_VOLUME_MESSAGE0 }) } }; Blockly.Blocks.labplus_uart_mp3_set_status = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "status", type: "field_dropdown", options: [[Blockly.Msg.STOP, "STOP"]] }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_UART_MP3_SET_STATUS_HELPURL, tooltip: Blockly.Msg.LABPLUS_UART_MP3_SET_STATUS_TOOLTIP, message0: Blockly.Msg.LABPLUS_UART_MP3_SET_STATUS_MESSAGE0 }) } }; Blockly.Blocks.labplus_uart_init = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "tx", check: "Number", type: "input_value" }, { name: "rx", check: "Number", type: "input_value" }, { name: "baudrate", check: "Number", type: "input_value" }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_UART_INIT_HELPURL, tooltip: Blockly.Msg.LABPLUS_UART_INIT_TOOLTIP, message0: Blockly.Msg.LABPLUS_UART_INIT_MESSAGE0 }) } }; Blockly.Blocks.labplus_uart_any_msg_received = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "status", type: "field_dropdown", options: [[Blockly.Msg.BLUEBIT_INFRARED_SIGNAL, "2"], [Blockly.Msg.BLUEBIT_BLUEBOOTH, "3"]] }], helpUrl: Blockly.Msg.LABPLUS_UART_ANY_MSG_RECEIVED_HELPURL, tooltip: Blockly.Msg.LABPLUS_UART_ANY_MSG_RECEIVED_TOOLTIP, message0: Blockly.Msg.LABPLUS_UART_ANY_MSG_RECEIVED_MESSAGE0, output: "Boolean" }) } }; Blockly.Blocks.labplus_uart_read_msg = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "status", type: "field_dropdown", options: [[Blockly.Msg.BLUEBIT_INFRARED_SIGNAL, "2"], [Blockly.Msg.BLUEBIT_BLUEBOOTH, "3"]] }], helpUrl: Blockly.Msg.LABPLUS_UART_READ_MSG_HELPURL, tooltip: Blockly.Msg.LABPLUS_UART_READ_MSG_TOOLTIP, message0: Blockly.Msg.LABPLUS_UART_READ_MSG_MESSAGE0, output: ["Number", "String"] }) } }; Blockly.Blocks.labplus_uart_write_msg = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ name: "status", type: "field_dropdown", options: [[Blockly.Msg.BLUEBIT_INFRARED_SIGNAL, "2"], [Blockly.Msg.BLUEBIT_BLUEBOOTH, "3"]] }, { type: "input_value", name: "msg0", check: ["Array", "String"] }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_UART_WRITE_MSG_HELPURL, tooltip: Blockly.Msg.LABPLUS_UART_WRITE_MSG_TOOLTIP, message0: Blockly.Msg.LABPLUS_UART_WRITE_MSG_MESSAGE0 }) } }; Blockly.Blocks.labplus_uart_set_oled = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ type: "input_dummy" }, { type: "input_value", name: "x1", check: "Number" }, { type: "input_value", name: "y1", check: "Number" }, { type: "input_value", name: "msg0", check: "String" }, { type: "field_dropdown", name: "font", options: [["Font 5x7", "0"], ["\u5b8b\u4f53 16x16", "1"], ["\u5b8b\u4f53 24x24", "2"], ["Consolas 32x32", "4"]] }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_UART_SET_OLCD_HELPURL, tooltip: Blockly.Msg.LABPLUS_UART_SET_OLCD_TOOLTIP, message0: Blockly.Msg.LABPLUS_UART_SET_OLCD_MESSAGE0, inputsInline: !1 }) } }; Blockly.Blocks.labplus_uart_set_lcd_clear = { init: function () { this.jsonInit({ colour: bluebitdigital, args0: [{ type: "input_dummy" }, { type: "input_value", name: "x1", check: "Number" }, { type: "input_value", name: "y1", check: "Number" }, { type: "input_value", name: "x2", check: "Number" }, { type: "input_value", name: "y2", check: "Number" }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_UART_SET_OLCD_CLEAR_HELPURL, tooltip: Blockly.Msg.LABPLUS_UART_SET_OLCD_CLEAR_TOOLTIP, message0: Blockly.Msg.LABPLUS_UART_SET_OLCD_CLEAR_MESSAGE0, inputsInline: !1 }) } }; Blockly.Blocks.labplus_uart_set_lcd_clear_all = { init: function () { this.jsonInit({ colour: bluebitdigital, nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_UART_SET_OLCD_CLEAR_ALL_HELPURL, tooltip: Blockly.Msg.LABPLUS_UART_SET_OLCD_CLEAR_ALL_TOOLTIP, message0: Blockly.Msg.LABPLUS_UART_SET_OLCD_CLEAR_ALL_MESSAGE0, inputsInline: !1 }) } }; Blockly.Blocks.labplus_compitition_init_extended_pins = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [{ name: "extendedPins", options: extendedPins, type: "field_dropdown" }, { name: "PinMode", options: [[Blockly.Msg.LABPLUS_COMPITITION_INIT_EXTENDED_PINS_INPUT, "1"], [Blockly.Msg.LABPLUS_COMPITITION_INIT_EXTENDED_PINS_OUTPUT, "0"]], type: "field_dropdown" }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_COMPITITION_INIT_EXTENDED_PINS_HELPURL, tooltip: Blockly.Msg.LABPLUS_COMPITITION_INIT_EXTENDED_PINS_TOOLTIP, message0: Blockly.Msg.LABPLUS_COMPITITION_INIT_EXTENDED_PINS_MESSAGE0 }) } }; Blockly.Blocks.labplus_set_extio_mode = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [{ type: "input_dummy" }, { name: "mode0", options: [[Blockly.Msg.LABPLUS_SET_EXTIO_MODE_INPUT, "1"], [Blockly.Msg.LABPLUS_SET_EXTIO_MODE_OUTPUT, "0"]], type: "field_dropdown" }, { type: "input_dummy" }, { name: "mode1", options: [[Blockly.Msg.LABPLUS_SET_EXTIO_MODE_INPUT, "1"], [Blockly.Msg.LABPLUS_SET_EXTIO_MODE_OUTPUT, "0"]], type: "field_dropdown" }, { type: "input_dummy" }, { name: "mode2", options: [[Blockly.Msg.LABPLUS_SET_EXTIO_MODE_INPUT, "1"], [Blockly.Msg.LABPLUS_SET_EXTIO_MODE_OUTPUT, "0"]], type: "field_dropdown" }, { type: "input_dummy" }, { name: "mode3", options: [[Blockly.Msg.LABPLUS_SET_EXTIO_MODE_INPUT, "1"], [Blockly.Msg.LABPLUS_SET_EXTIO_MODE_OUTPUT, "0"]], type: "field_dropdown" }, { type: "input_dummy" }, { name: "mode4", options: [[Blockly.Msg.LABPLUS_SET_EXTIO_MODE_INPUT, "1"], [Blockly.Msg.LABPLUS_SET_EXTIO_MODE_OUTPUT, "0"]], type: "field_dropdown" }, { type: "input_dummy" }, { name: "mode5", options: [[Blockly.Msg.LABPLUS_SET_EXTIO_MODE_INPUT, "1"], [Blockly.Msg.LABPLUS_SET_EXTIO_MODE_OUTPUT, "0"]], type: "field_dropdown" }, { type: "input_dummy" }, { name: "mode6", options: [[Blockly.Msg.LABPLUS_SET_EXTIO_MODE_INPUT, "1"], [Blockly.Msg.LABPLUS_SET_EXTIO_MODE_OUTPUT, "0"]], type: "field_dropdown" }, { type: "input_dummy" }, { name: "mode7", options: [[Blockly.Msg.LABPLUS_SET_EXTIO_MODE_INPUT, "1"], [Blockly.Msg.LABPLUS_SET_EXTIO_MODE_OUTPUT, "0"]], type: "field_dropdown" }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_SET_EXTIO_MODE_HELPURL, tooltip: Blockly.Msg.LABPLUS_SET_EXTIO_MODE_TOOLTIP, message0: Blockly.Msg.LABPLUS_SET_EXTIO_MODE_MESSAGE0 }) } }; Blockly.Blocks.labplus_read_extended_pin = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [{ name: "extendedPins", options: extendedPins, type: "field_dropdown" }], output: "Number", helpUrl: Blockly.Msg.LABPLUS_READ_EXTENDED_PIN_HELPURL, tooltip: Blockly.Msg.LABPLUS_READ_EXTENDED_PIN_TOOLTIP, message0: Blockly.Msg.LABPLUS_READ_EXTENDED_PIN_MESSAGE0 }) } }; Blockly.Blocks.labplus_write_extended_pin = { init: function () { this.jsonInit({ colour: bluebiti2c, args0: [{ name: "extendedPins", options: extendedPins, type: "field_dropdown" }, { type: "input_value", name: "PinValue", check: "Number" }], nextStatement: null, previousStatement: null, helpUrl: Blockly.Msg.LABPLUS_WRITE_EXTENDED_PIN_HELPURL, tooltip: Blockly.Msg.LABPLUS_WRITE_EXTENDED_PIN_TOOLTIP, message0: Blockly.Msg.LABPLUS_WRITE_EXTENDED_PIN_MESSAGE0 }) } }; Blockly.Blocks.labplus_mapping = { init: function () { this.jsonInit({ colour: 230, args0: [{ name: "inputNum", type: "input_value", check: "Number" }, { name: "bMin", type: "input_value", check: "Number" }, { name: "bMax", type: "input_value", check: "Number" }, { name: "cMin", type: "input_value", check: "Number" }, { name: "cMax", type: "input_value", check: "Number" }], output: "Number", message0: Blockly.Msg.labplus_mapping_MESSAGE0, tooltip: Blockly.Msg.labplus_mapping_TOOLTIP, helpUrl: Blockly.Msg.labplus_mapping_HELPURL }) } }; Blockly.Blocks.labplus_voice_record_on = { init: function () { this.jsonInit({ colour: 30, args0: [{ name: "func", type: "field_dropdown", options: [[Blockly.Msg.LABPLUS_VOICE_RECORD_PLAY, "play"], [Blockly.Msg.LABPLUS_VOICE_RECORD_REC, "rec"]] }, { name: "pinpair", type: "field_dropdown", options: labplus_pin_pair }], helpUrl: Blockly.Msg.LABPLUS_VOICE_RECORD_ON_HELPURL, tooltip: Blockly.Msg.LABPLUS_VOICE_RECORD_ON_TOOLTIP, message0: Blockly.Msg.LABPLUS_VOICE_RECORD_ON_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_voice_record_off = { init: function () { this.jsonInit({ colour: 30, args0: [{ name: "pinpair", type: "field_dropdown", options: labplus_pin_pair }], helpUrl: Blockly.Msg.LABPLUS_VOICE_RECORD_OFF_HELPURL, tooltip: Blockly.Msg.LABPLUS_VOICE_RECORD_OFF_TOOLTIP, message0: Blockly.Msg.LABPLUS_VOICE_RECORD_OFF_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_motor_on = { init: function () { this.jsonInit({ colour: 30, args0: [{ name: "status", type: "field_dropdown", options: [[Blockly.Msg.LABPLUS_MOTOR_ON_CLOCKWISE, "1"], [Blockly.Msg.LABPLUS_MOTOR_ON_ANTICLOCKWISE, "0"]] }, { name: "speed", type: "input_value", check: "Number" }, { name: "pinpair", type: "field_dropdown", options: labplus_pin_pair }], helpUrl: Blockly.Msg.LABPLUS_MOTOR_ON_HELPURL, tooltip: Blockly.Msg.LABPLUS_MOTOR_ON_TOOLTIP, message0: Blockly.Msg.LABPLUS_MOTOR_ON_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.labplus_motor_off = { init: function () { this.jsonInit({ colour: 30, args0: [{ name: "pinpair", type: "field_dropdown", options: labplus_pin_pair }], helpUrl: Blockly.Msg.LABPLUS_MOTOR_OFF_HELPURL, tooltip: Blockly.Msg.LABPLUS_MOTOR_OFF_TOOLTIP, message0: Blockly.Msg.LABPLUS_MOTOR_OFF_MESSAGE0, nextStatement: null, previousStatement: null }) } }; var microbit_ext2_color = "#c90370"; Blockly.Blocks.microbit_ext2_set_servo = { init: function () { this.jsonInit({ colour: microbit_ext2_color, args0: [{ name: "servo", type: "field_dropdown", options: [["S1", "1"], ["S2", "2"], ["S3", "3"], ["S4", "4"]] }, { name: "degree", type: "input_value", check: "Number" }], nextStatement: null, previousStatement: null, message0: Blockly.Msg.MICROBIT_EXT2_SET_SERVO_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_EXT2_SET_SERVO_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_EXT2_SET_SERVO_HELPURL }) } }; Blockly.Blocks.microbit_ext2_set_motor = { init: function () { this.jsonInit({ colour: microbit_ext2_color, args0: [{ name: "motor", type: "field_dropdown", options: [["M1", "1"], ["M2", "2"], ["M3", "3"], ["M4", "4"]] }, { name: "dir", type: "field_dropdown", options: [[Blockly.Msg.LABPLUS_MOTOR_ON_CLOCKWISE, "0"], [Blockly.Msg.LABPLUS_MOTOR_ON_ANTICLOCKWISE, "1"]] }, { name: "spd", type: "input_value", check: "Number" }], message0: Blockly.Msg.MICROBIT_EXT2_SET_MOTOR_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_EXT2_SET_MOTOR_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_EXT2_SET_MOTOR_HELPURL, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.microbit_ext2_stop_motor = { init: function () { this.jsonInit({ colour: microbit_ext2_color, args0: [{ name: "motor", type: "field_dropdown", options: [["M1", "1"], ["M2", "2"], ["M3", "3"], ["M4", "4"]] }], message0: Blockly.Msg.MICROBIT_EXT2_STOP_MOTOR_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_EXT2_STOP_MOTOR_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_EXT2_STOP_MOTOR_HELPURL, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.microbit_ext2_set_pwm = { init: function () { this.jsonInit({ colour: microbit_ext2_color, args0: [{ name: "channel", type: "field_dropdown", options: [["S1", "1"], ["S2", "2"], ["S3", "3"], ["S4", "4"]] }, { name: "pwm", type: "input_value", check: "Number" }], nextStatement: null, previousStatement: null, message0: Blockly.Msg.MICROBIT_EXT2_SET_PWM_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_EXT2_SET_PWM_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_EXT2_SET_PWM_HELPURL }) } }; Blockly.Blocks.microbit_ext2_step_motor = { init: function () { this.jsonInit({ colour: microbit_ext2_color, args0: [{ name: "motor", type: "field_dropdown", options: [["1", "1"], ["2", "2"]] }, { name: "dir", type: "field_dropdown", options: [[Blockly.Msg.LABPLUS_SET_MOTOR_CLOCKWISE, "1"], [Blockly.Msg.LABPLUS_SET_MOTOR_ANTI_CLOCKWISE, "0"]] }, { name: "speed", type: "input_value", check: "Number" }], nextStatement: null, previousStatement: null, message0: Blockly.Msg.MICROBIT_EXT2_STEP_MOTOR_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_EXT2_STEP_MOTOR_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_EXT2_STEP_MOTOR_HELPURL }) } }; Blockly.Blocks.microbit_ext2_sound_value = { init: function () { this.jsonInit({ colour: microbit_ext2_color, output: "Number", message0: Blockly.Msg.MICROBIT_EXT2_SOUND_VALUE_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_EXT2_SOUND_VALUE_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_EXT2_SOUND_VALUE_HELPURL }) } }; Blockly.Blocks.microbit_ext2_light_value = { init: function () { this.jsonInit({ colour: microbit_ext2_color, output: "Number", message0: Blockly.Msg.MICROBIT_EXT2_LIGHT_VALUE_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_EXT2_LIGHT_VALUE_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_EXT2_LIGHT_VALUE_HELPURL }) } }; Blockly.Blocks.botbit_setHSV = { init: function () { this.jsonInit({ inputsInline: !0, nextStatement: null, previousStatement: null, colour: 30, helpUrl: Blockly.Msg.BOTBIT_setHSV_HELPURL, tooltip: Blockly.Msg.BOTBIT_setHSV_TOOLTIP, message0: Blockly.Msg.BOTBIT_setHSV_MESSAGE0, args0: [{ options: [[Blockly.Msg.BOTBIT_MOONWALKER_L, "4"], [Blockly.Msg.BOTBIT_MOONWALKER_R, "5"]], type: "field_dropdown", name: "left_right" }, { check: "Number", type: "input_value", name: "h" }, { check: "Number", type: "input_value", name: "s" }, { check: "Number", type: "input_value", name: "v" }] }) } }; Blockly.Blocks.botbit_setRGB = { init: function () { this.jsonInit({ inputsInline: !0, nextStatement: null, previousStatement: null, colour: 30, helpUrl: Blockly.Msg.BOTBIT_setRGB_HELPURL, tooltip: Blockly.Msg.BOTBIT_setRGB_TOOLTIP, message0: Blockly.Msg.BOTBIT_setRGB_MESSAGE0, args0: [{ options: [[Blockly.Msg.BOTBIT_MOONWALKER_L, "2"], [Blockly.Msg.BOTBIT_MOONWALKER_R, "3"]], type: "field_dropdown", name: "left_right" }, { check: "Number", type: "input_value", name: "r" }, { check: "Number", type: "input_value", name: "g" }, { check: "Number", type: "input_value", name: "b" }] }) } }; Blockly.Blocks.botbit_turn = { init: function () { this.jsonInit({ inputsInline: !0, nextStatement: null, previousStatement: null, colour: 30, helpUrl: Blockly.Msg.BOTBIT_TURN_HELPURL, tooltip: Blockly.Msg.BOTBIT_TURN_TOOLTIP, message0: Blockly.Msg.BOTBIT_TURN_MESSAGE0, args0: [{ check: "Number", type: "input_value", name: "steps" }, { check: "Number", type: "input_value", name: "t" }, { options: [[Blockly.Msg.BOTBIT_MOTOR_FORWARD, "1"], [Blockly.Msg.BOTBIT_MOTOR_BACKWARD, "-1"]], type: "field_dropdown", name: "dir" }] }) } }; Blockly.Blocks.botbit_jump = { init: function () { this.jsonInit({ inputsInline: !0, nextStatement: null, previousStatement: null, colour: 30, helpUrl: Blockly.Msg.BOTBIT_JUMP_HELPURL, tooltip: Blockly.Msg.BOTBIT_JUMP_TOOLTIP, message0: Blockly.Msg.BOTBIT_JUMP_MESSAGE0, args0: [{ check: "Number", type: "input_value", name: "t" }] }) } }; Blockly.Blocks.botbit_spd = { init: function () { this.jsonInit({ colour: 30, args0: [{ name: "spd", type: "field_dropdown", options: [["2000", "2000"], ["1000", "1000"], ["500", "500"], ["0", "0"], ["-500", "-500"], ["-1000", "-1000"], ["-2000", "-2000"]] }], helpUrl: "", tooltip: "", message0: "%1", output: "Number" }) } }; Blockly.Blocks.botbit_motor_on = { init: function () { this.jsonInit({ colour: 30, args0: [{ type: "input_dummy" }, { name: "speedl", type: "input_value", check: "Number" }, { name: "speedr", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.BOTBIT_MOTOR_ON_HELPURL, tooltip: Blockly.Msg.BOTBIT_MOTOR_ON_TOOLTIP, message0: Blockly.Msg.BOTBIT_MOTOR_ON_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.botbit_holdBall = { init: function () { this.jsonInit({ colour: 30, helpUrl: Blockly.Msg.BOTBIT_HOLDBALL_HELPURL, tooltip: Blockly.Msg.BOTBIT_HOLDBALL_TOOLTIP, message0: Blockly.Msg.BOTBIT_HOLDBALL_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.botbit_Steering_EngineL = { init: function () { this.jsonInit({ colour: "#e8795b", args0: [ { name: "dir", type: "field_dropdown", options: [[Blockly.Msg.BOTBIT_SERVO_X, "AcX"], [Blockly.Msg.BOTBIT_SERVO_Y, "AcY"], [Blockly.Msg.BOTBIT_SERVO_Z, "AcZ"]] } ], helpUrl: Blockly.Msg.BOTBIT_STEERING_ENGINEL_HELPURL, tooltip: Blockly.Msg.BOTBIT_STEERING_ENGINEL_TOOLTIP, message0: Blockly.Msg.BOTBIT_STEERING_ENGINEL_MESSAGE0 //nextStatement: null, //previousStatement: null }) this.setOutput(!0); } }; Blockly.Blocks.botbit_Steering_Tilt = { init: function () { this.jsonInit({ colour: "#e8795b", args0: [ { name: "dir", type: "field_dropdown", options: [[Blockly.Msg.BOTBIT_SERVO_X, "X"], [Blockly.Msg.BOTBIT_SERVO_Y, "Y"], [Blockly.Msg.BOTBIT_SERVO_Z, "Z"]] } ], helpUrl: Blockly.Msg.BOTBIT_STEERING_ENGINEL_HELPURL, tooltip: Blockly.Msg.BOTBIT_STEERING_ENGINEL_TOOLTIP, message0: Blockly.Msg.BOTBIT_STEERING_ENGINET_MESSAGE0 }) this.setOutput(!0); } }; Blockly.Blocks.botbit_Steering_RGB = { init: function () { var _input = this.appendDummyInput(); _input.appendField(Blockly.Msg.X); this.appendValueInput("R").setCheck("Number"); _input = this.appendDummyInput(); _input.appendField(Blockly.Msg.Y) this.appendValueInput("G").setCheck("Number"); _input = this.appendDummyInput(); _input.appendField(Blockly.Msg.Y) this.appendValueInput("B").setCheck("Number"); this.setInputsInline(!0); this.setHelpUrl(Blockly.Msg.LOGIC_OPERATION_HELPURL); this.setColour("#5bb2d6"); this.setOutput(!0, "Boolean"); } }; Blockly.Blocks.botbit_Steering_RGB = function (block) { var _r = Blockly.Python.valueToCode(block, "R", Blockly.Python.ORDER_ATOMIC); var _g = Blockly.Python.valueToCode(block, "G", Blockly.Python.ORDER_ATOMIC); var _b = Blockly.Python.valueToCode(block, "B", Blockly.Python.ORDER_ATOMIC); var code = "(" + _r + ", " + _g + ", " + _b + ")"; return [code, Blockly.Python.ORDER_ATOMIC]; }; Blockly.Blocks.botbit_Steering_XY = { init: function () { var _input = this.appendDummyInput(); this.setHelpUrl(Blockly.Msg.LOGIC_OPERATION_HELPURL); this.setColour("#5bb2d6"); this.setOutput(!0, "Boolean"); _input.appendField(Blockly.Msg.X); this.appendValueInput("A").setCheck("Number"); _input = this.appendDummyInput(); _input.appendField(Blockly.Msg.Y) this.appendValueInput("B").setCheck("Number"); this.setInputsInline(!0); } }; Blockly.Python.botbit_Steering_XY = function (block) { var _x = Blockly.Python.valueToCode(block, "A", Blockly.Python.ORDER_ATOMIC); var _y = Blockly.Python.valueToCode(block, "B", Blockly.Python.ORDER_ATOMIC); var code = "(" + _x + ", " + _y + ")"; return [code, Blockly.Python.ORDER_ATOMIC]; }; Blockly.Blocks.botbit_Steering_WH = { init: function () { var _input = this.appendDummyInput(); this.setHelpUrl(Blockly.Msg.LOGIC_OPERATION_HELPURL); this.setColour("#5bb2d6"); this.setOutput(!0, "Boolean"); _input.appendField(Blockly.Msg.W); this.appendValueInput("A").setCheck("Number"); _input = this.appendDummyInput(); _input.appendField(Blockly.Msg.H) this.appendValueInput("B").setCheck("Number"); this.setInputsInline(!0); } }; Blockly.Python.botbit_Steering_WH = function (block) { var _x = Blockly.Python.valueToCode(block, "A", Blockly.Python.ORDER_ATOMIC); var _y = Blockly.Python.valueToCode(block, "B", Blockly.Python.ORDER_ATOMIC); var code = "(" + _x + ", " + _y + ")"; return [code, Blockly.Python.ORDER_ATOMIC]; }; Blockly.Blocks.botbit_Steering_Engine_leg = { init: function () { this.jsonInit({ colour: 30, args0: [{ name: "leg", type: "field_dropdown", options: [[Blockly.Msg.BOTBIT_MOTOR_LEFT, "l"], [Blockly.Msg.BOTBIT_MOTOR_RIGHT, "r"]] }, { name: "dir", type: "field_dropdown", options: [[Blockly.Msg.BOTBIT_SERVO_UP, "y"], [Blockly.Msg.BOTBIT_SERVO_DOWN, "x"]] }, { name: "walk", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.BOTBIT_STEERING_ENGINE_LEG_HELPURL, tooltip: Blockly.Msg.BOTBIT_STEERING_ENGINE_LEG_TOOLTIP, message0: Blockly.Msg.BOTBIT_STEERING_ENGINE_LEG_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.botbit_updatePosition = { init: function () { this.jsonInit({ colour: 30, helpUrl: Blockly.Msg.BOTBIT_UPDATEPOSITION_HELPURL, tooltip: Blockly.Msg.BOTBIT_UPDATEPOSITION_TOOLTIP, message0: Blockly.Msg.BOTBIT_UPDATEPOSITION_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.botbit_Ultrasonic = { init: function () { this.jsonInit({ colour: 30, helpUrl: Blockly.Msg.BOTBIT_ULTRASONIC_HELPURL, tooltip: Blockly.Msg.BOTBIT_ULTRASONIC_TOOLTIP, message0: Blockly.Msg.BOTBIT_ULTRASONIC_MESSAGE0, output: "Number" }) } }; Blockly.Blocks.botbit_walking = { init: function () { this.jsonInit({ colour: 30, args0: [{ name: "fx", type: "field_dropdown", options: [[Blockly.Msg.BOTBIT_WALKING_FORWARD, "-1"], [Blockly.Msg.BOTBIT_WALKING_BACK, "1"]] }, { name: "steps", type: "input_value", check: "Number" }, { name: "T", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.BOTBIT_WALKING_HELPURL, tooltip: Blockly.Msg.BOTBIT_WALKING_TOOLTIP, message0: Blockly.Msg.BOTBIT_WALKING_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.botbit_moonwalker = { init: function () { this.jsonInit({ colour: 30, args0: [{ name: "fx", type: "field_dropdown", options: [[Blockly.Msg.BOTBIT_MOONWALKER_L, "-1"], [Blockly.Msg.BOTBIT_MOONWALKER_R, "1"]] }, { name: "steps2", type: "input_value", check: "Number" }, { name: "T2", type: "input_value", check: "Number" }, { name: "amplitude", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.BOTBIT_MOONWALKER_HELPURL, tooltip: Blockly.Msg.BOTBIT_MOONWALKER_TOOLTIP, message0: Blockly.Msg.BOTBIT_MOONWALKER_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.botbit_PIDtracking = { init: function () { this.jsonInit({ colour: 30, args0: [{ type: "input_dummy" }, { name: "kp", type: "input_value", check: "Number" }, { name: "kd", type: "input_value", check: "Number" }, { name: "trackSpeed", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.BOTBIT_PIDtracking_HELPURL, tooltip: Blockly.Msg.BOTBIT_PIDtracking_TOOLTIP, message0: Blockly.Msg.BOTBIT_PIDtracking_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.botbit_crusaito = { init: function () { this.jsonInit({ colour: 30, args0: [{ name: "fx", type: "field_dropdown", options: [[Blockly.Msg.BOTBIT_CRUSAITO_CW, "-1"], [Blockly.Msg.BOTBIT_CRUSAITO_ANTICW, "1"]] }, { name: "steps3", type: "input_value", check: "Number" }, { name: "T3", type: "input_value", check: "Number" }, { name: "amplitude3", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.BOTBIT_CRUSAITO_HELPURL, tooltip: Blockly.Msg.BOTBIT_CRUSAITO_TOOLTIP, message0: Blockly.Msg.BOTBIT_CRUSAITO_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.botbit_flapping = { init: function () { this.jsonInit({ colour: 30, args0: [{ name: "fx", type: "field_dropdown", options: [[Blockly.Msg.BOTBIT_FLAPPING_FORWARD, "-1"], [Blockly.Msg.BOTBIT_FLAPPING_BACK, "1"]] }, { name: "steps4", type: "input_value", check: "Number" }, { name: "T4", type: "input_value", check: "Number" }, { name: "amplitude4", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.BOTBIT_FLAPPING_HELPURL, tooltip: Blockly.Msg.BOTBIT_FLAPPING_TOOLTIP, message0: Blockly.Msg.BOTBIT_FLAPPING_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.botbit_home = { init: function () { this.jsonInit({ colour: 30, helpUrl: Blockly.Msg.BOTBIT_HOME_HELPURL, tooltip: Blockly.Msg.BOTBIT_HOME_TOOLTIP, message0: Blockly.Msg.BOTBIT_HOME_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.Carbit_init = { init: function () { this.jsonInit({ colour: 88, nextStatement: null, previousStatement: null, message0: Blockly.Msg.Carbit_init_MESSAGE0, tooltip: Blockly.Msg.Carbit_init_TOOLTIP, helpUrl: Blockly.Msg.Carbit_init_HELPURL }) } }; Blockly.Blocks.Carbit_setLeftMotor = { init: function () { this.jsonInit({ colour: 88, args0: [{ name: "LeftMotor", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.Carbit_setLeftMotor_HELPURL, tooltip: Blockly.Msg.Carbit_setLeftMotor_TOOLTIP, message0: Blockly.Msg.Carbit_setLeftMotor_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.Carbit_setRightMotor = { init: function () { this.jsonInit({ colour: 88, args0: [{ name: "RightMotor", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.Carbit_setRightMotor_HELPURL, tooltip: Blockly.Msg.Carbit_setRightMotor_TOOLTIP, message0: Blockly.Msg.Carbit_setRightMotor_MESSAGE0, nextStatement: null, previousStatement: null }) } }; Blockly.Blocks.Carbit_analog_light = { init: function () { this.jsonInit({ colour: 88, args0: [{ name: "light", type: "field_dropdown", options: [["Q3", "1"], ["Q4", "2"]] }], helpUrl: Blockly.Msg.Carbit_analog_light_HELPURL, tooltip: Blockly.Msg.Carbit_analog_light_TOOLTIP, message0: Blockly.Msg.Carbit_analog_light_MESSAGE0, output: "Number" }) } }; Blockly.Blocks.Carbit_Speed_U10 = { init: function () { this.jsonInit({ colour: 88, helpUrl: Blockly.Msg.Carbit_Speed_U10_HELPURL, tooltip: Blockly.Msg.Carbit_Speed_U10_TOOLTIP, message0: Blockly.Msg.Carbit_Speed_U10_MESSAGE0, output: "Number" }) } }; Blockly.Blocks.Carbit_Speed_U11 = { init: function () { this.jsonInit({ colour: 88, helpUrl: Blockly.Msg.Carbit_Speed_U11_HELPURL, tooltip: Blockly.Msg.Carbit_Speed_U11_TOOLTIP, message0: Blockly.Msg.Carbit_Speed_U11_MESSAGE0, output: "Number" }) } }; Blockly.Blocks.Carbit_Distance = { init: function () { this.jsonInit({ colour: 88, helpUrl: Blockly.Msg.Carbit_Distance_HELPURL, tooltip: Blockly.Msg.Carbit_Distance_TOOLTIP, message0: Blockly.Msg.Carbit_Distance_MESSAGE0, output: "Number" }) } }; Blockly.Blocks.Carbit_tracking = { init: function () { this.jsonInit({ colour: 88, args0: [{ type: "input_dummy" }, { name: "k_speed", type: "input_value", check: "Number" }, { name: "speedMax", type: "input_value", check: "Number" }, { name: "speedScale", type: "input_value", check: "Number" }, { name: "turnDelay", type: "input_value", check: "Number" }], helpUrl: Blockly.Msg.Carbit_tracking_HELPURL, tooltip: Blockly.Msg.Carbit_tracking_TOOLTIP, message0: Blockly.Msg.Carbit_tracking_MESSAGE0, nextStatement: null, previousStatement: null }) } }; var gamebitColor = 230; Blockly.Blocks.gamebit_xy = { init: function () { this.jsonInit({ inputsInline: !0, output: "Number", colour: gamebitColor, helpUrl: Blockly.Msg.GAMEBIT_XY_HELPURL, tooltip: Blockly.Msg.GAMEBIT_XY_TOOLTIP, message0: Blockly.Msg.GAMEBIT_XY_MESSAGE0, args0: [{ options: [["X", "2"], ["Y", "1"]], type: "field_dropdown", name: "xy" }] }) } }; Blockly.Blocks.gamebit_shake = { init: function () { this.jsonInit({ inputsInline: !0, nextStatement: null, previousStatement: null, colour: gamebitColor, helpUrl: Blockly.Msg.GAMEBIT_SHAKE_HELPURL, tooltip: Blockly.Msg.GAMEBIT_SHAKE_TOOLTIP, message0: Blockly.Msg.GAMEBIT_SHAKE_MESSAGE0, args0: [{ options: [[Blockly.Msg.LABPLUS_USB_SWITCH_OFF, "0"], [Blockly.Msg.LABPLUS_USB_SWITCH_ON, "1"]], type: "field_dropdown", name: "shake" }] }) } }; Blockly.Blocks.gamebit_button = { init: function () { this.jsonInit({ inputsInline: !0, output: "Boolean", colour: gamebitColor, helpUrl: Blockly.Msg.GAMEBIT_BUTTON_HELPURL, tooltip: Blockly.Msg.GAMEBIT_BUTTON_TOOLTIP, message0: Blockly.Msg.GAMEBIT_BUTTON_MESSAGE0, args0: [{ options: [["START", "6"], ["SElECT", "7"], ["A", "4"], ["B", "3"], ["X", "2"], ["Y", "1"], ["Z", "5"]], type: "field_dropdown", name: "button" }] }) } }; var COLOR_MU = "#FF6600"; Blockly.Blocks.microbit_mu_init = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ name: "address", options: [["0x60", "0x60"], ["0x61", "0x61"], ["0x62", "0x62"], ["0x63", "0x63"]], type: "field_dropdown" }], nextStatement: null, previousStatement: null, message0: Blockly.Msg.MICROBIT_MU_INIT_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_INIT_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_INIT_HELPURL }) } }; Blockly.Blocks.microbit_mu_begin = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ check: "String", type: "input_value", name: "vision_type" }], nextStatement: null, previousStatement: null, message0: Blockly.Msg.MICROBIT_MU_BEGIN_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_BEGIN_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_BEGIN_HELPURL }) } }; Blockly.Blocks.microbit_mu_vision_type_multi = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ checked: !1, type: "field_checkbox", name: "type1" }, { checked: !1, type: "field_checkbox", name: "type2" }, { type: "input_dummy" }, { checked: !1, type: "field_checkbox", name: "type3" }, { checked: !1, type: "field_checkbox", name: "type4" }, { type: "input_dummy" }, { checked: !1, type: "field_checkbox", name: "type5" }, { checked: !1, type: "field_checkbox", name: "type6" }, { type: "input_dummy" }, { checked: !1, type: "field_checkbox", name: "type7" }, { checked: !1, type: "field_checkbox", name: "type8" }], output: "String", message0: Blockly.Msg.MICROBIT_MU_VISION_TYPE_MESSAGE0, tooltip: "", helpUrl: "" }) } }; Blockly.Blocks.microbit_mu_vision_type = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ name: "vision_type", options: [[Blockly.Msg.MICROBIT_MU_VISION_COLOR_DETECT, "VISION_COLOR_DETECT"], [Blockly.Msg.MICROBIT_MU_VISION_COLOR_RECOGNITION, "VISION_COLOR_RECOGNITION"], [Blockly.Msg.MICROBIT_MU_VISION_BALL_DETECT, "VISION_BALL_DETECT"], [Blockly.Msg.MICROBIT_MU_VISION_BODY_DETECT, "VISION_BODY_DETECT"], [Blockly.Msg.MICROBIT_MU_VISION_SHAPE_CARD_DETECT, "VISION_SHAPE_CARD_DETECT"], [Blockly.Msg.MICROBIT_MU_VISION_TRAFFIC_CARD_DETECT, "VISION_TRAFFIC_CARD_DETECT"], [Blockly.Msg.MICROBIT_MU_VISION_NUM_CARD_DETECT, "VISION_NUM_CARD_DETECT"]], type: "field_dropdown" }], output: "String", message0: "%1", tooltip: "", helpUrl: "" }) } }; Blockly.Blocks.microbit_mu_set_level = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ check: "String", type: "input_value", name: "vision_type" }, { name: "level", options: [[Blockly.Msg.MICROBIT_MU_LEVEL_DEFAULT, "LevelDefault"], [Blockly.Msg.MICROBIT_MU_LEVEL_SPEED, "LevelSpeed"], [Blockly.Msg.MICROBIT_MU_LEVEL_BALANCE, "LevelBalance"], [Blockly.Msg.MICROBIT_MU_LEVEL_ACCURACY, "LevelAccuracy"]], type: "field_dropdown" }], nextStatement: null, previousStatement: null, message0: Blockly.Msg.MICROBIT_MU_SET_LEVEL_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_SET_LEVEL_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_SET_LEVEL_HELPURL }) } }; Blockly.Blocks.microbit_mu_get_level = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ check: "String", type: "input_value", name: "vision_type" }], output: "Number", message0: Blockly.Msg.MICROBIT_MU_GET_LEVEL_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_GET_LEVEL_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_GET_LEVEL_HELPURL }) } }; Blockly.Blocks.microbit_mu_set_fps_mode = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ name: "mode", options: [[Blockly.Msg.MICROBIT_MU_FPS_NORMAL, "FPSNormal"], [Blockly.Msg.MICROBIT_MU_FPS_HIGH, "FPSHigh"]], type: "field_dropdown" }], nextStatement: null, previousStatement: null, message0: Blockly.Msg.MICROBIT_MU_SET_FPS_MODE_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_SET_FPS_MODE_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_SET_FPS_MODE_HELPURL }) } }; Blockly.Blocks.microbit_mu_get_fps_mode = { init: function () { this.jsonInit({ colour: COLOR_MU, output: "Number", message0: Blockly.Msg.MICROBIT_MU_GET_FPS_MODE_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_GET_FPS_MODE_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_GET_FPS_MODE_HELPURL }) } }; Blockly.Blocks.microbit_mu_set_awb_mode = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ name: "mode", options: [[Blockly.Msg.MICROBIT_MU_AUTO_WHITE_BALANCE, "AutoWhiteBalance"], [Blockly.Msg.MICROBIT_MU_LOCK_WHITE_BALANCE, "LockWhiteBalance"], [Blockly.Msg.MICROBIT_MU_WHITE_LIGHT, "WhiteLight"], [Blockly.Msg.MICROBIT_MU_YELLOW_LIGHT, "YellowLight"]], type: "field_dropdown" }], nextStatement: null, previousStatement: null, message0: Blockly.Msg.MICROBIT_MU_SET_AWB_MODE_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_SET_AWB_MODE_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_SET_AWB_MODE_HELPURL }) } }; Blockly.Blocks.microbit_mu_get_awb_mode = { init: function () { this.jsonInit({ colour: COLOR_MU, output: "Number", message0: Blockly.Msg.MICROBIT_MU_GET_AWB_MODE_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_GET_AWB_MODE_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_GET_AWB_MODE_HELPURL }) } }; Blockly.Blocks.microbit_mu_set_zoom_mode = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ name: "mode", options: [[Blockly.Msg.MICROBIT_MU_ZOOM_DEFAULT, "ZoomDefault"], [Blockly.Msg.MICROBIT_MU_ZOOM_1, "Zoom1"], [Blockly.Msg.MICROBIT_MU_ZOOM_2, "Zoom2"], [Blockly.Msg.MICROBIT_MU_ZOOM_3, "Zoom3"], [Blockly.Msg.MICROBIT_MU_ZOOM_4, "Zoom4"], [Blockly.Msg.MICROBIT_MU_ZOOM_5, "Zoom5"]], type: "field_dropdown" }], nextStatement: null, previousStatement: null, message0: Blockly.Msg.MICROBIT_MU_SET_ZOOM_MODE_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_SET_ZOOM_MODE_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_SET_ZOOM_MODE_HELPURL }) } }; Blockly.Blocks.microbit_mu_get_zoom_mode = { init: function () { this.jsonInit({ colour: COLOR_MU, output: "Number", message0: Blockly.Msg.MICROBIT_MU_GET_ZOOM_MODE_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_GET_ZOOM_MODE_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_GET_ZOOM_MODE_HELPURL }) } }; Blockly.Blocks.microbit_mu_set_default = { init: function () { this.jsonInit({ colour: COLOR_MU, nextStatement: null, previousStatement: null, message0: Blockly.Msg.MICROBIT_MU_SET_DEFAULT_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_SET_DEFAULT_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_SET_DEFAULT_HELPURL }) } }; Blockly.Blocks.microbit_mu_restart = { init: function () { this.jsonInit({ colour: COLOR_MU, nextStatement: null, previousStatement: null, message0: Blockly.Msg.MICROBIT_MU_RESTART_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_RESTART_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_RESTART_HELPURL }) } }; Blockly.Blocks.microbit_mu_led_level = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ name: "level", options: [["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"], ["4", "4"], ["5", "5"], ["6", "6"], ["7", "7"], ["8", "8"], ["9", "9"], ["10", "10"], ["11", "11"], ["12", "12"], ["13", "13"], ["14", "14"], ["15", "15"]], type: "field_dropdown" }], output: "Number", message0: "%1", tooltip: "", helpUrl: "" }) } }; Blockly.Blocks.microbit_mu_led_set_color = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ name: "led", options: [["Led1", "Led1"], ["Led2", "Led2"], ["LedAll", "LedAll"]], type: "field_dropdown" }, { check: "Number", type: "input_value", name: "level" }, { name: "detected_color", options: [[Blockly.Msg.MICROBIT_MU_LED_CLOSE, "LedClose"], [Blockly.Msg.MICROBIT_MU_LED_RED, "LedRed"], [Blockly.Msg.MICROBIT_MU_LED_GREEN, "LedGreen"], [Blockly.Msg.MICROBIT_MU_LED_YELLOW, "LedYellow"], [Blockly.Msg.MICROBIT_MU_LED_BLUE, "LedBlue"], [Blockly.Msg.MICROBIT_MU_LED_PURPLE, "LedPurple"], [Blockly.Msg.MICROBIT_MU_LED_CYAN, "LedCyan"], [Blockly.Msg.MICROBIT_MU_LED_WHITE, "LedWhite"]], type: "field_dropdown" }, { type: "input_dummy" }, { name: "undetected_color", options: [[Blockly.Msg.MICROBIT_MU_LED_CLOSE, "LedClose"], [Blockly.Msg.MICROBIT_MU_LED_RED, "LedRed"], [Blockly.Msg.MICROBIT_MU_LED_GREEN, "LedGreen"], [Blockly.Msg.MICROBIT_MU_LED_YELLOW, "LedYellow"], [Blockly.Msg.MICROBIT_MU_LED_BLUE, "LedBlue"], [Blockly.Msg.MICROBIT_MU_LED_PURPLE, "LedPurple"], [Blockly.Msg.MICROBIT_MU_LED_CYAN, "LedCyan"], [Blockly.Msg.MICROBIT_MU_LED_WHITE, "LedWhite"]], type: "field_dropdown" }], nextStatement: null, previousStatement: null, message0: Blockly.Msg.MICROBIT_MU_LED_SET_COLOR_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_LED_SET_COLOR_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_LED_SET_COLOR_HELPURL }) } }; Blockly.Blocks.microbit_mu_get_value = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ check: "String", type: "input_value", name: "vision_type" }, { name: "object_inf", options: [[Blockly.Msg.MICROBIT_MU_VALUE_STATUS, "Status"], [Blockly.Msg.MICROBIT_MU_VALUE_XVALUE, "XValue"], [Blockly.Msg.MICROBIT_MU_VALUE_YVALUE, "YValue"], [Blockly.Msg.MICROBIT_MU_VALUE_WIDTHVALUE, "WidthValue"], [Blockly.Msg.MICROBIT_MU_VALUE_HEIGHTVALUE, "HeightValue"], [Blockly.Msg.MICROBIT_MU_VALUE_LABEL, "Label"], [Blockly.Msg.MICROBIT_MU_VALUE_RVALUE, "RValue"], [Blockly.Msg.MICROBIT_MU_VALUE_GVALUE, "GValue"], [Blockly.Msg.MICROBIT_MU_VALUE_BVALUE, "BValue"]], type: "field_dropdown" }], output: null, message0: Blockly.Msg.MICROBIT_MU_GET_VALUE_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_GET_VALUE_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_GET_VALUE_HELPURL }) } }; Blockly.Blocks.microbit_mu_ls_type = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ name: "ls_type", options: [[Blockly.Msg.MICROBIT_MU_LS_PROXIMITY_ENABLE, "LS_PROXIMITY_ENABLE"], [Blockly.Msg.MICROBIT_MU_LS_AMBIENT_LIGHT_ENABLE, "LS_AMBIENT_LIGHT_ENABLE"], [Blockly.Msg.MICROBIT_MU_LS_COLOR_ENABLE, "LS_COLOR_ENABLE"], [Blockly.Msg.MICROBIT_MU_LS_GESTURE_ENABLE, "LS_GESTURE_ENABLE"]], type: "field_dropdown" }], output: "String", message0: "%1", tooltip: "", helpUrl: "" }) } }; Blockly.Blocks.microbit_mu_ls_begin = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ check: "String", type: "input_value", name: "ls_type" }], nextStatement: null, previousStatement: null, message0: Blockly.Msg.MICROBIT_MU_LS_BEGIN_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_LS_BEGIN_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_LS_BEGIN_HELPURL }) } }; Blockly.Blocks.microbit_mu_ls_end = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ check: "String", type: "input_value", name: "ls_type" }], nextStatement: null, previousStatement: null, message0: Blockly.Msg.MICROBIT_MU_LS_END_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_LS_END_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_LS_END_HELPURL }) } }; Blockly.Blocks.microbit_mu_ls_set_sensitivity = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ name: "sensitivity", options: [[Blockly.Msg.MICROBIT_MU_LS_SENSITIVITY_DEFAULT, "SensitivityDefault"], [Blockly.Msg.MICROBIT_MU_LS_SENSITIVITY_1, "Sensitivity1"], [Blockly.Msg.MICROBIT_MU_LS_SENSITIVITY_2, "Sensitivity2"], [Blockly.Msg.MICROBIT_MU_LS_SENSITIVITY_3, "Sensitivity3"]], type: "field_dropdown" }], nextStatement: null, previousStatement: null, message0: Blockly.Msg.MICROBIT_MU_LS_SET_SENSITIVITY_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_LS_SET_SENSITIVITY_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_LS_SET_SENSITIVITY_HELPURL }) } }; Blockly.Blocks.microbit_mu_ls_wb_enable = { init: function () { this.jsonInit({ colour: COLOR_MU, nextStatement: null, previousStatement: null, message0: Blockly.Msg.MICROBIT_MU_LS_WB_ENABLE_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_LS_WB_ENABLE_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_LS_WB_ENABLE_HELPURL }) } }; Blockly.Blocks.microbit_mu_ls_read_proximity = { init: function () { this.jsonInit({ colour: COLOR_MU, output: "Number", message0: Blockly.Msg.MICROBIT_MU_LS_READ_PROXIMITY_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_LS_READ_PROXIMITY_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_LS_READ_PROXIMITY_HELPURL }) } }; Blockly.Blocks.microbit_mu_ls_read_ambient_light = { init: function () { this.jsonInit({ colour: COLOR_MU, output: "Number", message0: Blockly.Msg.MICROBIT_MU_LS_READ_AMBIENT_LIGHT_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_LS_READ_AMBIENT_LIGHT_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_LS_READ_AMBIENT_LIGHT_HELPURL }) } }; Blockly.Blocks.microbit_mu_ls_read_color = { init: function () { this.jsonInit({ colour: COLOR_MU, args0: [{ name: "color_t", options: [[Blockly.Msg.MICROBIT_MU_LS_COLOR_LABEL, "LsColorLabel"], [Blockly.Msg.MICROBIT_MU_LS_COLOR_RED, "LsColorRed"], [Blockly.Msg.MICROBIT_MU_LS_COLOR_GREEN, "LsColorGreen"], [Blockly.Msg.MICROBIT_MU_LS_COLOR_BLUE, "LsColorBlue"], [Blockly.Msg.MICROBIT_MU_LS_RAW_COLOR_RED, "LsRawColorRed"], [Blockly.Msg.MICROBIT_MU_LS_RAW_COLOR_GREEN, "LsRawColorGreen"], [Blockly.Msg.MICROBIT_MU_LS_RAW_COLOR_BLUE, "LsRawColorBlue"], [Blockly.Msg.MICROBIT_MU_LS_COLOR_HUE, "LsColorHue"], [Blockly.Msg.MICROBIT_MU_LS_COLOR_SATURATION, "LsColorSaturation"], [Blockly.Msg.MICROBIT_MU_LS_COLOR_VALUE, "LsColorValue"]], type: "field_dropdown" }], output: "Number", message0: Blockly.Msg.MICROBIT_MU_LS_READ_COLOR_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_LS_READ_COLOR_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_LS_READ_COLOR_HELPURL }) } }; Blockly.Blocks.microbit_mu_ls_read_gesture = { init: function () { this.jsonInit({ colour: COLOR_MU, output: "Number", message0: Blockly.Msg.MICROBIT_MU_LS_READ_GESTURE_MESSAGE0, tooltip: Blockly.Msg.MICROBIT_MU_LS_READ_GESTURE_TOOLTIP, helpUrl: Blockly.Msg.MICROBIT_MU_LS_READ_GESTURE_HELPURL }) } };