2016-05-05 20:16:14 +02:00
{
2016-05-27 18:23:47 +02:00
"Math.randomBoolean" : "Generates a `true` or `false` value randomly, just like flipping a coin." ,
2016-06-19 14:14:46 +02:00
"Math.randomBoolean|block" : "pick random true or false" ,
"Math|block" : "Math" ,
2016-05-27 18:23:47 +02:00
"String.fromCharCode" : "Make a string from the given ASCII character code." ,
2016-06-19 14:14:46 +02:00
"String.fromCharCode|block" : "text from char code %code" ,
"String|block" : "String" ,
2016-05-06 23:17:39 +02:00
"basic" : "Provides access to basic micro:bit functionality." ,
"basic.clearScreen" : "Turn off all LEDs" ,
2016-06-19 14:14:46 +02:00
"basic.clearScreen|block" : "clear screen" ,
2016-05-06 23:17:39 +02:00
"basic.forever" : "Repeats the code forever in the background. On each iteration, allows other codes to run." ,
2016-06-19 14:14:46 +02:00
"basic.forever|block" : "forever" ,
2016-05-06 23:17:39 +02:00
"basic.pause" : "Pause for the specified time in milliseconds" ,
2016-06-19 14:14:46 +02:00
"basic.pause|block" : "pause (ms) %pause" ,
"basic.pause|param|ms" : "how long to pause for, eg: 100, 200, 500, 1000, 2000" ,
2016-05-06 23:17:39 +02:00
"basic.plotLeds" : "Draws an image on the LED screen." ,
2016-06-19 14:14:46 +02:00
"basic.plotLeds|param|leds" : "pattern of LEDs to turn on/off" ,
2016-05-06 23:17:39 +02:00
"basic.showAnimation" : "Shows a sequence of LED screens as an animation." ,
2016-06-19 14:14:46 +02:00
"basic.showAnimation|param|interval" : "time in milliseconds between each redraw" ,
"basic.showAnimation|param|leds" : "pattern of LEDs to turn on/off" ,
2016-05-06 23:17:39 +02:00
"basic.showLeds" : "Draws an image on the LED screen." ,
2016-06-19 14:14:46 +02:00
"basic.showLeds|block" : "show leds" ,
"basic.showLeds|param|interval" : "time in milliseconds to pause after drawing" ,
"basic.showLeds|param|leds" : "the pattern of LED to turn on/off" ,
2016-05-06 23:17:39 +02:00
"basic.showNumber" : "Scroll a number on the screen. If the number fits on the screen (i.e. is a single digit), do not scroll." ,
2016-06-19 14:14:46 +02:00
"basic.showNumber|block" : "show|number %number" ,
"basic.showNumber|param|interval" : "speed of scroll; eg: 150, 100, 200, -100" ,
2016-05-06 23:17:39 +02:00
"basic.showString" : "Display text on the display, one character at a time. If the string fits on the screen (i.e. is one letter), does not scroll." ,
2016-06-19 14:14:46 +02:00
"basic.showString|block" : "show|string %text" ,
"basic.showString|param|interval" : "how fast to shift characters; eg: 150, 100, 200, -100" ,
"basic.showString|param|text" : "the text to scroll on the screen, eg: \"Hello!\"" ,
"basic|block" : "basic" ,
2016-05-06 23:17:39 +02:00
"control" : "Runtime and event utilities." ,
"control.inBackground" : "Schedules code that run in the background." ,
2016-06-19 14:14:46 +02:00
"control.inBackground|block" : "run in background" ,
2016-05-06 23:17:39 +02:00
"control.reset" : "Resets the BBC micro:bit." ,
2016-06-19 14:14:46 +02:00
"control.reset|block" : "reset" ,
"control|block" : "control" ,
2016-05-06 23:17:39 +02:00
"game" : "A single-LED sprite game engine" ,
"game.addScore" : "Adds points to the current score" ,
2016-06-19 14:14:46 +02:00
"game.addScore|block" : "change score by|%points" ,
"game.addScore|param|points" : "amount of points to change, eg: 1" ,
2016-05-06 23:17:39 +02:00
"game.gameOver" : "Displays a game over animation." ,
2016-06-19 14:14:46 +02:00
"game.gameOver|block" : "game over" ,
2016-05-06 23:17:39 +02:00
"game.score" : "Gets the current score" ,
2016-06-19 14:14:46 +02:00
"game.score|block" : "score" ,
2016-05-06 23:17:39 +02:00
"game.setScore" : "Sets the current score value" ,
2016-06-19 14:14:46 +02:00
"game.setScore|param|value" : "TODO" ,
2016-05-06 23:17:39 +02:00
"game.startCountdown" : "Starts a game countdown timer" ,
2016-06-19 14:14:46 +02:00
"game.startCountdown|block" : "start countdown|(ms) %duration" ,
"game.startCountdown|param|ms" : "countdown duration in milliseconds, eg: 10000" ,
"game|block" : "game" ,
2016-05-06 23:17:39 +02:00
"images" : "Creation, manipulation and display of LED images." ,
"images.createBigImage" : "Creates an image with 2 frames." ,
2016-06-19 14:14:46 +02:00
"images.createBigImage|block" : "create big image" ,
2016-05-06 23:17:39 +02:00
"images.createImage" : "Creates an image that fits on the LED screen." ,
2016-06-19 14:14:46 +02:00
"images.createImage|block" : "create image" ,
"images|block" : "images" ,
2016-05-06 23:17:39 +02:00
"input" : "Events and data from sensors" ,
"input.acceleration" : "Get the acceleration value in milli-gravitys (when the board is laying flat with the screen up, x=0, y=0 and z=-1024)" ,
2016-06-19 14:14:46 +02:00
"input.acceleration|block" : "acceleration (mg)|%NAME" ,
"input.acceleration|param|dimension" : "TODO" ,
2016-05-06 23:17:39 +02:00
"input.buttonIsPressed" : "Get the button state (pressed or not) for ``A`` and ``B``." ,
2016-06-19 14:14:46 +02:00
"input.buttonIsPressed|block" : "button|%NAME|is pressed" ,
2016-05-06 23:17:39 +02:00
"input.calibrate" : "Obsolete, compass calibration is automatic." ,
"input.compassHeading" : "Get the current compass compass heading in degrees." ,
2016-06-19 14:14:46 +02:00
"input.compassHeading|block" : "compass heading (°)" ,
2016-05-06 23:17:39 +02:00
"input.lightLevel" : "Reads the light level applied to the LED screen in a range from ``0`` (dark) to ``255`` bright." ,
2016-06-19 14:14:46 +02:00
"input.lightLevel|block" : "light level" ,
2016-05-06 23:17:39 +02:00
"input.magneticForce" : "Get the magnetic force value in ``micro-Teslas`` (``µT``). This function is not supported in the simulator." ,
2016-06-19 14:14:46 +02:00
"input.magneticForce|block" : "magnetic force (µT)|%NAME" ,
"input.magneticForce|param|dimension" : "TODO" ,
2016-05-06 23:17:39 +02:00
"input.onButtonPressed" : "Do something when a button (``A``, ``B`` or both ``A+B``) is pressed" ,
2016-06-19 14:14:46 +02:00
"input.onButtonPressed|block" : "on button|%NAME|pressed" ,
"input.onButtonPressed|param|body" : "TODO" ,
"input.onButtonPressed|param|button" : "TODO" ,
2016-05-06 23:17:39 +02:00
"input.onGesture" : "Attaches code to run when the screen is facing up." ,
2016-06-19 14:14:46 +02:00
"input.onGesture|block" : "on |%NAME" ,
"input.onGesture|param|body" : "TODO" ,
2016-05-06 23:17:39 +02:00
"input.onLogoDown" : "Attaches code to run when the logo is oriented downwards and the board is vertical." ,
2016-06-19 14:14:46 +02:00
"input.onLogoDown|param|body" : "TODO" ,
2016-05-06 23:17:39 +02:00
"input.onLogoUp" : "Attaches code to run when the logo is oriented upwards and the board is vertical." ,
2016-06-19 14:14:46 +02:00
"input.onLogoUp|param|body" : "TODO" ,
2016-05-06 23:17:39 +02:00
"input.onPinPressed" : "Do something when a pin(``P0``, ``P1`` or both ``P2``) is pressed." ,
2016-06-19 14:14:46 +02:00
"input.onPinPressed|block" : "on pin|%NAME|pressed" ,
"input.onPinPressed|param|body" : "TODO" ,
"input.onPinPressed|param|name" : "TODO" ,
2016-05-06 23:17:39 +02:00
"input.onScreenDown" : "Attaches code to run when the screen is facing down." ,
2016-06-19 14:14:46 +02:00
"input.onScreenDown|param|body" : "TODO" ,
2016-05-06 23:17:39 +02:00
"input.onScreenUp" : "Attaches code to run when the screen is facing up." ,
2016-06-19 14:14:46 +02:00
"input.onScreenUp|param|body" : "TODO" ,
2016-05-06 23:17:39 +02:00
"input.onShake" : "Attaches code to run when the device is shaken." ,
2016-06-19 14:14:46 +02:00
"input.onShake|param|body" : "TODO" ,
2016-05-06 23:17:39 +02:00
"input.pinIsPressed" : "Get the pin state (pressed or not). Requires to hold the ground to close the circuit." ,
2016-07-27 17:42:58 +02:00
"input.pinIsPressed|block" : "pin %NAME|is pressed" ,
2016-06-19 14:14:46 +02:00
"input.pinIsPressed|param|name" : "pin used to detect the touch" ,
2016-05-06 23:17:39 +02:00
"input.rotation" : "The pitch of the device, rotation along the ``x-axis``, in degrees." ,
2016-06-19 14:14:46 +02:00
"input.rotation|block" : "rotation (°)|%NAME" ,
"input.rotation|param|kind" : "TODO" ,
2016-05-06 23:17:39 +02:00
"input.runningTime" : "Gets the number of milliseconds elapsed since power on." ,
2016-06-19 14:14:46 +02:00
"input.runningTime|block" : "running time (ms)" ,
2016-05-06 23:17:39 +02:00
"input.setAccelerometerRange" : "Sets the accelerometer sample range in gravities." ,
2016-06-19 14:14:46 +02:00
"input.setAccelerometerRange|block" : "set accelerometer|range %range" ,
"input.setAccelerometerRange|param|range" : "a value describe the maximum strengh of acceleration measured" ,
2016-05-06 23:17:39 +02:00
"input.temperature" : "Gets the temperature in Celsius degrees (°C)." ,
2016-06-19 14:14:46 +02:00
"input.temperature|block" : "temperature (°C)" ,
"input|block" : "input" ,
2016-05-06 23:17:39 +02:00
"led" : "Control of the LED screen." ,
"led.brightness" : "Get the screen brightness from 0 (off) to 255 (full bright)." ,
2016-06-19 14:14:46 +02:00
"led.brightness|block" : "brightness" ,
2016-05-06 23:17:39 +02:00
"led.fadeIn" : "Fades in the screen display." ,
2016-06-19 14:14:46 +02:00
"led.fadeIn|param|ms" : "TODO" ,
2016-05-06 23:17:39 +02:00
"led.fadeOut" : "Fades out the screen brightness." ,
2016-06-19 14:14:46 +02:00
"led.fadeOut|param|ms" : "TODO" ,
2016-05-06 23:17:39 +02:00
"led.plot" : "Turn on the specified LED using x, y coordinates (x is horizontal, y is vertical). (0,0) is upper left." ,
"led.plotAll" : "Turns all LEDS on" ,
"led.plotBarGraph" : "Displays a vertical bar graph based on the `value` and `high` value.\nIf `high` is 0, the chart gets adjusted automatically." ,
2016-06-19 14:14:46 +02:00
"led.plotBarGraph|block" : "plot bar graph of %value |up to %high" ,
"led.plotBarGraph|param|high" : "maximum value. If 0, maximum value adjusted automatically, eg: 0" ,
"led.plotBarGraph|param|value" : "current value to plot" ,
"led.plot|block" : "plot|x %x|y %y" ,
"led.plot|param|x" : "TODO" ,
"led.plot|param|y" : "TODO" ,
2016-05-06 23:17:39 +02:00
"led.point" : "Get the on/off state of the specified LED using x, y coordinates. (0,0) is upper left." ,
2016-06-19 14:14:46 +02:00
"led.point|block" : "point|x %x|y %y" ,
"led.point|param|x" : "TODO" ,
"led.point|param|y" : "TODO" ,
2016-05-06 23:17:39 +02:00
"led.screenshot" : "Takes a screenshot of the LED screen and returns an image." ,
"led.setBrightness" : "Set the screen brightness from 0 (off) to 255 (full bright)." ,
2016-06-19 14:14:46 +02:00
"led.setBrightness|block" : "set brightness %value" ,
"led.setBrightness|param|value" : "the brightness value, eg:255, 127, 0" ,
2016-05-06 23:17:39 +02:00
"led.setDisplayMode" : "Sets the display mode between black and white and greyscale for rendering LEDs." ,
2016-06-19 14:14:46 +02:00
"led.setDisplayMode|param|mode" : "TODO" ,
2016-05-06 23:17:39 +02:00
"led.stopAnimation" : "Cancels the current animation and clears other pending animations." ,
2016-06-19 14:14:46 +02:00
"led.stopAnimation|block" : "stop animation" ,
2016-05-06 23:17:39 +02:00
"led.toggle" : "Toggles a particular pixel" ,
"led.toggleAll" : "Inverts the current LED display" ,
2016-06-19 14:14:46 +02:00
"led.toggle|param|x" : "TODO" ,
"led.toggle|param|y" : "TODO" ,
2016-05-06 23:17:39 +02:00
"led.unplot" : "Turn off the specified LED using x, y coordinates (x is horizontal, y is vertical). (0,0) is upper left." ,
2016-06-19 14:14:46 +02:00
"led.unplot|block" : "unplot|x %x|y %y" ,
"led.unplot|param|x" : "TODO" ,
"led.unplot|param|y" : "TODO" ,
"led|block" : "led" ,
2016-05-06 23:17:39 +02:00
"music" : "Generation of music tones through pin ``P0``." ,
"music.beat" : "Returns the duration of a beat in milli-seconds" ,
2016-06-19 14:14:46 +02:00
"music.beat|block" : "%fraction|beat" ,
2016-05-06 23:17:39 +02:00
"music.changeTempoBy" : "Change the tempo by the specified amount" ,
2016-06-19 14:14:46 +02:00
"music.changeTempoBy|block" : "change tempo by (bpm)|%value" ,
"music.changeTempoBy|param|bpm" : "The change in beats per minute to the tempo, eg: 20" ,
2016-05-06 23:17:39 +02:00
"music.noteFrequency" : "Gets the frequency of a note." ,
2016-06-19 14:14:46 +02:00
"music.noteFrequency|block" : "%note" ,
"music.noteFrequency|param|name" : "the note name" ,
2016-05-06 23:17:39 +02:00
"music.playTone" : "Plays a tone through pin ``P0`` for the given duration." ,
2016-06-19 14:14:46 +02:00
"music.playTone|block" : "play|tone %note=device_note|for %duration=device_beat" ,
"music.playTone|param|frequency" : "pitch of the tone to play in Hertz (Hz)" ,
"music.playTone|param|ms" : "tone duration in milliseconds (ms)" ,
2016-05-06 23:17:39 +02:00
"music.rest" : "Rests (plays nothing) for a specified time through pin ``P0``." ,
2016-06-19 14:14:46 +02:00
"music.rest|block" : "rest(ms)|%duration=device_beat" ,
"music.rest|param|ms" : "rest duration in milliseconds (ms)" ,
2016-05-06 23:17:39 +02:00
"music.ringTone" : "Plays a tone through pin ``P0``." ,
2016-06-19 14:14:46 +02:00
"music.ringTone|block" : "ring tone (Hz)|%note=device_note" ,
"music.ringTone|param|frequency" : "pitch of the tone to play in Hertz (Hz)" ,
2016-05-06 23:17:39 +02:00
"music.setTempo" : "Sets the tempo to the specified amount" ,
2016-06-19 14:14:46 +02:00
"music.setTempo|block" : "set tempo to (bpm)|%value" ,
"music.setTempo|param|bpm" : "The new tempo in beats per minute, eg: 120" ,
2016-05-06 23:17:39 +02:00
"music.tempo" : "Returns the tempo in beats per minute. Tempo is the speed (bpm = beats per minute) at which notes play. The larger the tempo value, the faster the notes will play." ,
2016-06-19 14:14:46 +02:00
"music.tempo|block" : "tempo (bpm)" ,
"music|block" : "music" ,
2016-05-06 23:17:39 +02:00
"pins" : "Control currents in Pins for analog/digital signals, servos, i2c, ..." ,
"pins.analogPitch" : "Emits a Pulse-width modulation (PWM) signal to the current pitch pin. Use `analog set pitch pin` to define the pitch pin." ,
2016-06-19 14:14:46 +02:00
"pins.analogPitch|param|frequency" : "TODO" ,
"pins.analogPitch|param|ms" : "TODO" ,
2016-05-06 23:17:39 +02:00
"pins.analogReadPin" : "Read the connector value as analog, that is, as a value comprised between 0 and 1023." ,
2016-06-19 14:14:46 +02:00
"pins.analogReadPin|block" : "analog read|pin %name" ,
"pins.analogReadPin|param|name" : "pin to write to" ,
2016-05-06 23:17:39 +02:00
"pins.analogSetPeriod" : "Configures the Pulse-width modulation (PWM) of the analog output to the given value in **microseconds** or `1/1000` milliseconds.\nIf this pin is not configured as an analog output (using `analog write pin`), the operation has no effect." ,
2016-06-19 14:14:46 +02:00
"pins.analogSetPeriod|block" : "analog set period|pin %pin|to (µs)%micros" ,
"pins.analogSetPeriod|param|micros" : "period in micro seconds. eg:20000" ,
"pins.analogSetPeriod|param|name" : "analog pin to set period to" ,
2016-05-06 23:17:39 +02:00
"pins.analogSetPitchPin" : "Sets the pin used when using `pins->analog pitch`." ,
2016-06-19 14:14:46 +02:00
"pins.analogSetPitchPin|param|name" : "TODO" ,
2016-05-06 23:17:39 +02:00
"pins.analogWritePin" : "Set the connector value as analog. Value must be comprised between 0 and 1023." ,
2016-06-19 14:14:46 +02:00
"pins.analogWritePin|block" : "analog write|pin %name|to %value" ,
"pins.analogWritePin|param|name" : "pin name to write to" ,
"pins.analogWritePin|param|value" : "value to write to the pin between ``0`` and ``1023``. eg:1023,0" ,
2016-05-06 23:17:39 +02:00
"pins.digitalReadPin" : "Read the specified pin or connector as either 0 or 1" ,
2016-06-19 14:14:46 +02:00
"pins.digitalReadPin|block" : "digital read|pin %name" ,
"pins.digitalReadPin|param|name" : "pin to read from" ,
2016-05-06 23:17:39 +02:00
"pins.digitalWritePin" : "Set a pin or connector value to either 0 or 1." ,
2016-06-19 14:14:46 +02:00
"pins.digitalWritePin|block" : "digital write|pin %name|to %value" ,
"pins.digitalWritePin|param|name" : "pin to write to" ,
"pins.digitalWritePin|param|value" : "value to set on the pin, 1 eg,0" ,
2016-05-17 07:18:58 +02:00
"pins.i2cReadNumber" : "Read one number from 7-bit I2C address." ,
2016-06-19 14:14:46 +02:00
"pins.i2cReadNumber|block" : "i2c read number|at address %address|of format %format=i2c_sizeof" ,
2016-05-17 07:18:58 +02:00
"pins.i2cWriteNumber" : "Write one number to a 7-bit I2C address." ,
2016-06-19 14:14:46 +02:00
"pins.i2cWriteNumber|block" : "i2c write number|at address %address|with value %value|of format %format=i2c_sizeof" ,
2016-05-06 23:17:39 +02:00
"pins.map" : "Re-maps a number from one range to another. That is, a value of ``from low`` would get mapped to ``to low``, a value of ``from high`` to ``to high``, values in-between to values in-between, etc." ,
2016-06-19 14:14:46 +02:00
"pins.map|block" : "map %value|from low %fromLow|from high %fromHigh|to low %toLow|to high %toHigh" ,
"pins.map|param|fromHigh" : "the upper bound of the value's current range, eg: 1023" ,
"pins.map|param|fromLow" : "the lower bound of the value's current range" ,
"pins.map|param|toHigh" : "the upper bound of the value's target range, eg: 4" ,
"pins.map|param|toLow" : "the lower bound of the value's target range" ,
"pins.map|param|value" : "value to map in ranges" ,
2016-05-17 07:18:58 +02:00
"pins.onPulsed" : "Configures this pin to a digital input, and generates events where the timestamp is the duration that this pin was either ``high`` or ``low``." ,
2016-06-19 14:14:46 +02:00
"pins.onPulsed|block" : "on|pin %pin|pulsed %pulse" ,
2016-05-27 18:23:47 +02:00
"pins.pulseDuration" : "Gets the duration of the last pulse in micro-seconds. This function should be called from a ``onPulsed`` handler." ,
2016-06-19 14:14:46 +02:00
"pins.pulseDuration|block" : "pulse duration (µs)" ,
2016-05-06 23:17:39 +02:00
"pins.servoSetPulse" : "Configures this IO pin as an analog/pwm output, configures the period to be 20 ms, and sets the pulse width, based on the value it is given **microseconds** or `1/1000` milliseconds." ,
2016-06-19 14:14:46 +02:00
"pins.servoSetPulse|block" : "servo set pulse|pin %value|to (µs) %micros" ,
"pins.servoSetPulse|param|micros" : "pulse duration in micro seconds, eg:1500" ,
"pins.servoSetPulse|param|name" : "pin name" ,
2016-05-06 23:17:39 +02:00
"pins.servoWritePin" : "Writes a value to the servo, controlling the shaft accordingly. On a standard servo, this will set the angle of the shaft (in degrees), moving the shaft to that orientation. On a continuous rotation servo, this will set the speed of the servo (with ``0`` being full-speed in one direction, ``180`` being full speed in the other, and a value near ``90`` being no movement)." ,
2016-06-19 14:14:46 +02:00
"pins.servoWritePin|block" : "servo write|pin %name|to %value" ,
"pins.servoWritePin|param|name" : "pin to write to" ,
"pins.servoWritePin|param|value" : "angle or rotation speed, eg:180,90,0" ,
2016-06-16 07:50:23 +02:00
"pins.setPull" : "Configures the pull of this pin." ,
2016-06-19 14:14:46 +02:00
"pins.setPull|block" : "set pull|pin %pin|to %pull" ,
"pins.setPull|param|name" : "pin to set the pull mode on" ,
"pins.setPull|param|pull" : "one of the mbed pull configurations: PullUp, PullDown, PullNone " ,
"pins|block" : "pins" ,
2016-05-06 23:17:39 +02:00
"serial" : "Reading and writing data over a serial connection." ,
2016-05-27 18:23:47 +02:00
"serial.readLine" : "Reads a line of text from the serial port." ,
2016-06-19 14:14:46 +02:00
"serial.readLine|block" : "serial read line" ,
2016-05-27 18:23:47 +02:00
"serial.redirect" : "Dynamically configuring the serial instance to use pins other than USBTX and USBRX." ,
2016-06-19 14:14:46 +02:00
"serial.redirect|block" : "serial redirect to|TX %tx|RX %rx|at baud rate %rate" ,
"serial.redirect|param|rx" : "the new reception pin" ,
"serial.redirect|param|tx" : "the new transmission pins" ,
2016-05-06 23:17:39 +02:00
"serial.writeLine" : "Prints a line of text to the serial" ,
2016-06-19 14:14:46 +02:00
"serial.writeLine|block" : "serial|write line %text" ,
2016-05-27 18:23:47 +02:00
"serial.writeNumber" : "Prints a numeric value to the serial" ,
2016-06-19 14:14:46 +02:00
"serial.writeNumber|block" : "serial|write number %value" ,
2016-05-27 18:23:47 +02:00
"serial.writeString" : "Sends a piece of text through Serial connection." ,
2016-06-19 14:14:46 +02:00
"serial.writeString|block" : "serial write string %text" ,
"serial.writeValue" : "Writes a ``name: value`` pair line to the serial." ,
"serial.writeValue|block" : "serial|write value %name|= %value" ,
"serial.writeValue|param|name" : "name of the value stream, eg: x" ,
"serial.writeValue|param|value" : "to write" ,
"serial|block" : "serial"
2016-05-05 20:16:14 +02:00
}