merging master

This commit is contained in:
Peli de Halleux 2016-11-09 13:20:18 -08:00
commit 0b144539f3
22 changed files with 498 additions and 263 deletions

View File

@ -4,7 +4,6 @@ node_js:
script:
- "node node_modules/pxt-core/built/pxt.js travis"
- "node node_modules/pxt-core/built/pxt.js testdir tests"
- "node node_modules/pxt-core/built/pxt.js uploaddoc"
sudo: false
notifications:
email:

View File

@ -1,16 +0,0 @@
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@codethemicrobit" />
<meta name="twitter:title" content="code the micro:bit" />
<meta name="twitter:description" content="Blocks+JavaScript for programming your micro:bit" />
<meta name="twitter:image" content="https://az851932.vo.msecnd.net/pub/drbwxcth" />
<meta property="og:title" content="micro:bit editor" />
<meta property="og:description" content="Blocks+JavaScript for programming your micro:bit" />
<meta property="og:site_name" content="code the micro:bit" />
<meta property="og:image" content="https://az851932.vo.msecnd.net/pub/drbwxcth" />
<!--
Canonical URL needs to wait until main release is updated.
<meta property="og:url" content="https://codethemicrobit.com" />
<meta property="og:type" content="website" />
<meta property="fb:app_id" content="" />
-->

View File

@ -1,21 +0,0 @@
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@codethemicrobit" />
<meta name="twitter:title" content="@name@" />
<meta name="twitter:description" content="@description@" />
<meta name="twitter:image" content="@cardLogo@" />
<meta property="og:title" content="@name@" />
<meta property="og:site_name" content="code the micro:bit" />
<meta property="og:description" content="@description@" />
<meta property="og:image" content="@cardLogo@" />
<!--
<meta property="og:type" content="website" />
<meta property="fb:app_id" content="" />
-->
<link rel="apple-touch-icon" href="@appLogo@">
<link rel="icon" type="image/png" href="@appLogo@">
<link rel="mask-icon" href="https://az851932.vo.msecnd.net/pub/zwxazere/safari-pinned-tab.svg" color="#000000">
<link rel="shortcut icon" href="@appLogo@">
<meta name="theme-color" content="@accentColor@">

View File

@ -1,5 +0,0 @@
#root .avatar .avatar-image {
background-image: url(https://az851932.vo.msecnd.net/pub/jovrytni/microbit.simplified.svg);
background-size: contain;
background-repeat: no-repeat;
}

View File

@ -1,3 +1,3 @@
{
"appref": "v0.5.54"
"appref": "v0.5.63"
}

View File

@ -1,13 +1,45 @@
{
"Math.abs": "Returns the absolute value of a number (the value without regard to whether it is positive or negative). \nFor example, the absolute value of -5 is the same as the absolute value of 5.",
"Math.abs|param|x": "A numeric expression for which the absolute value is needed.",
"Math.max": "Returns the larger of two supplied numeric expressions.",
"Math.min": "Returns the smaller of two supplied numeric expressions.",
"Math.pow": "Returns the value of a base expression taken to a specified power.",
"Math.pow|param|x": "The base value of the expression.",
"Math.pow|param|y": "The exponent value of the expression.",
"Math.random": "Returns a pseudorandom number between 0 and `max`.",
"Math.randomBoolean": "Generates a `true` or `false` value randomly, just like flipping a coin.",
"Math.sign": "Returns the sign of the x, indicating whether x is positive, negative or zero.",
"Math.sign|param|x": "The numeric expression to test",
"Math.sqrt": "Returns the square root of a number.",
"Math.sqrt|param|x": "A numeric expression.",
"String.charAt": "Returns the character at the specified index.",
"String.charAt|param|index": "The zero-based index of the desired character.",
"String.charCodeAt": "Returns the Unicode value of the character at the specified location.",
"String.charCodeAt|param|index": "The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.",
"String.compare": "Determines whether relative order of two strings (in ASCII encoding).",
"String.compare|param|that": "String to compare to target string",
"String.concat": "Returns a string that contains the concatenation of two or more strings.",
"String.concat|param|other": "The string to append to the end of the string.",
"String.fromCharCode": "Make a string from the given ASCII character code.",
"String.isEmpty": "Returns a value indicating if the string is empty",
"String.length": "Returns the length of a String object.",
"String.substr": "Return substring of the current string.",
"String.substr|param|length": "number of characters to extract",
"String.substr|param|start": "first character index; can be negative from counting from the end, eg:0",
"basic": "Provides access to basic micro:bit functionality.",
"basic.clearScreen": "Turn off all LEDs",
"basic.color": "Converts the color name to a number",
"basic.forever": "Repeats the code forever in the background. On each iteration, allows other codes to run.",
"basic.pause": "Pause for the specified time in milliseconds",
"basic.pause|param|ms": "how long to pause for, eg: 100, 200, 500, 1000, 2000",
"basic.plotLeds": "Draws an image on the LED screen.",
"basic.plotLeds|param|leds": "pattern of LEDs to turn on/off",
"basic.rgbw": "Converts red, green, blue channels into a RGB color",
"basic.rgbw|param|blue": "value of the blue channel between 0 and 255. eg: 255",
"basic.rgbw|param|green": "value of the green channel between 0 and 255. eg: 255",
"basic.rgbw|param|red": "value of the red channel between 0 and 255. eg: 255",
"basic.rgbw|param|white": "value of the white channel between 0 and 255. eg: 0",
"basic.setLedColor": "Sets the color on the build-in LED. Set to 0 to turn off.",
"basic.showAnimation": "Shows a sequence of LED screens as an animation.",
"basic.showAnimation|param|interval": "time in milliseconds between each redraw",
"basic.showAnimation|param|leds": "pattern of LEDs to turn on/off",
@ -20,19 +52,51 @@
"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!\"",
"control": "Runtime and event utilities.",
"control.assert": "If the condition is false, display msg on serial console, and panic with code 098.",
"control.deviceName": "Gets a friendly name for the device derived from the its serial number",
"control.deviceSerialNumber": "Derive a unique, consistent serial number of this device from internal data.",
"control.eventSourceId": "Returns the value of a C++ runtime constant",
"control.eventTimestamp": "Gets the timestamp of the last event executed on the bus",
"control.eventValue": "Gets the value of the last event executed on the bus",
"control.eventValueId": "Returns the value of a C++ runtime constant",
"control.inBackground": "Schedules code that run in the background.",
"control.onEvent": "Raises an event in the event bus.",
"control.panic": "Display specified error code and stop the program.",
"control.raiseEvent": "Raises an event in the event bus.",
"control.raiseEvent|param|mode": "optional definition of how the event should be processed after construction (default is CREATE_AND_FIRE).",
"control.raiseEvent|param|src": "ID of the MicroBit Component that generated the event e.g. MICROBIT_ID_BUTTON_A.",
"control.raiseEvent|param|value": "Component specific code indicating the cause of the event.",
"control.reset": "Resets the BBC micro:bit.",
"control.runtimeWarning": "Display warning in the simulator.",
"control.waitMicros": "Blocks the current fiber for the given microseconds",
"control.waitMicros|param|micros": "number of micro-seconds to wait. eg: 4",
"game": "A single-LED sprite game engine",
"game.addLife": "Adds life points to the current life",
"game.addLife|param|lives": "TODO",
"game.addScore": "Adds points to the current score",
"game.addScore|param|points": "amount of points to change, eg: 1",
"game.createSprite": "Creates a new LED sprite pointing to the right.",
"game.createSprite|param|x": "sprite horizontal coordinate, eg: 2",
"game.createSprite|param|y": "sprite vertical coordinate, eg: 2",
"game.currentTime": "Gets the remaining time (since `start countdown`) or current time (since the device started or `start stopwatch`) in milliseconds.",
"game.gameOver": "Displays a game over animation.",
"game.invalidSprite": "Gets an invalid sprite; used to initialize locals.",
"game.isGameOver": "Indicates if the game is display the game over sequence.",
"game.isRunning": "Gets a value indicating if the game is still running. Returns `false` if game over.",
"game.level": "Gets the current level",
"game.levelUp": "Increments the level and display a message.",
"game.life": "Gets the current life",
"game.removeLife": "Removes some life",
"game.removeLife|param|life": "TODO",
"game.score": "Gets the current score",
"game.setLife": "Sets the current life value",
"game.setLife|param|value": "TODO",
"game.setScore": "Sets the current score value",
"game.setScore|param|value": "TODO",
"game.showScore": "Displays the score on the screen.",
"game.startCountdown": "Starts a game countdown timer",
"game.startCountdown|param|ms": "countdown duration in milliseconds, eg: 10000",
"game.startStopwatch": "Starts a stopwatch timer. `current time` will return the elapsed time.",
"images": "Creation, manipulation and display of LED images.",
"images.createBigImage": "Creates an image with 2 frames.",
"images.createImage": "Creates an image that fits on the LED screen.",
@ -103,18 +167,23 @@
"led.unplot": "Turn off the specified LED using x, y coordinates (x is horizontal, y is vertical). (0,0) is upper left.",
"led.unplot|param|x": "TODO",
"led.unplot|param|y": "TODO",
"motors": "Blocks to control the onboard motors",
"motors.dualMotorPower": "Controls two motors attached to the board.",
"motors.motorCommand": "Send break, coast or sleep commands to the motor",
"motors.motorPower": "Turns on the motor at a certain percent of power.",
"motors.motorPower|param|power": "%percent of power sent to the motor. Negative power goes backward. eg: 50",
"music": "Generation of music tones through pin ``P0``.",
"music.beat": "Returns the duration of a beat in milli-seconds",
"music.changeTempoBy": "Change the tempo by the specified amount",
"music.changeTempoBy|param|bpm": "The change in beats per minute to the tempo, eg: 20",
"music.noteFrequency": "Gets the frequency of a note.",
"music.noteFrequency|param|name": "the note name",
"music.playTone": "Plays a tone through pin ``P0`` for the given duration.",
"music.playTone": "Plays a tone through ``speaker`` for the given duration.",
"music.playTone|param|frequency": "pitch of the tone to play in Hertz (Hz)",
"music.playTone|param|ms": "tone duration in milliseconds (ms)",
"music.rest": "Rests (plays nothing) for a specified time through pin ``P0``.",
"music.rest|param|ms": "rest duration in milliseconds (ms)",
"music.ringTone": "Plays a tone through pin ``P0``.",
"music.ringTone": "Plays a tone through ``speaker``.",
"music.ringTone|param|frequency": "pitch of the tone to play in Hertz (Hz)",
"music.setTempo": "Sets the tempo to the specified amount",
"music.setTempo|param|bpm": "The new tempo in beats per minute, eg: 120",
@ -133,12 +202,16 @@
"pins.analogWritePin": "Set the connector value as analog. Value must be comprised between 0 and 1023.",
"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",
"pins.createBuffer": "Create a new zero-initialized buffer.",
"pins.createBuffer|param|size": "number of bytes in the buffer",
"pins.digitalReadPin": "Read the specified pin or connector as either 0 or 1",
"pins.digitalReadPin|param|name": "pin to read from",
"pins.digitalWritePin": "Set a pin or connector value to either 0 or 1.",
"pins.digitalWritePin|param|name": "pin to write to",
"pins.digitalWritePin|param|value": "value to set on the pin, 1 eg,0",
"pins.i2cReadBuffer": "Read `size` bytes from a 7-bit I2C `address`.",
"pins.i2cReadNumber": "Read one number from 7-bit I2C address.",
"pins.i2cWriteBuffer": "Write bytes to a 7-bit I2C `address`.",
"pins.i2cWriteNumber": "Write one number to a 7-bit I2C address.",
"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.",
"pins.map|param|fromHigh": "the upper bound of the value's current range, eg: 1023",
@ -148,6 +221,9 @@
"pins.map|param|value": "value to map in ranges",
"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``.",
"pins.pulseDuration": "Gets the duration of the last pulse in micro-seconds. This function should be called from a ``onPulsed`` handler.",
"pins.pulseIn": "Returns the duration of a pulse in microseconds",
"pins.pulseIn|param|name": "the pin which measures the pulse",
"pins.pulseIn|param|value": "the value of the pulse (default high)",
"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.",
"pins.servoSetPulse|param|micros": "pulse duration in micro seconds, eg:1500",
"pins.servoSetPulse|param|name": "pin name",
@ -157,9 +233,12 @@
"pins.setPull": "Configures the pull of this pin.",
"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.sizeOf": "Get the size in bytes of specified number format.",
"pins.spiWrite": "Write to the SPI slave and return the response",
"pins.spiWrite|param|value": "Data to be sent to the SPI slave",
"serial": "Reading and writing data over a serial connection.",
"serial.delimiters": "Returns the delimiter corresponding string",
"serial.onLineReceived": "Registers an event to be fired when a line has been received",
"serial.readLine": "Reads a line of text from the serial port.",
"serial.readUntil": "Reads a line of text from the serial port and returns the buffer when the delimiter is met.",
"serial.readUntil|param|delimiter": "text delimiter that separates each text chunk",

View File

@ -1,20 +1,38 @@
{
"Math.randomBoolean|block": "pick random true or false",
"Math|block": "Math",
"String.charAt|block": "char from %this|at %pos",
"String.compare|block": "compare %this| to %that",
"String.concat|block": "join %this|%other",
"String.fromCharCode|block": "text from char code %code",
"String.isEmpty|block": "%this| is empty",
"String.length|block": "length of %VALUE",
"String.substr|block": "substring of %this|from %start|of length %length",
"String|block": "String",
"basic.clearScreen|block": "clear screen",
"basic.color|block": "%c",
"basic.forever|block": "forever",
"basic.pause|block": "pause (ms) %pause",
"basic.rgbw|block": "red %red|green %green|blue %blue|white %white",
"basic.setLedColor|block": "set led to %color=color_id",
"basic.showLeds|block": "show leds",
"basic.showNumber|block": "show|number %number",
"basic.showString|block": "show|string %text",
"basic|block": "basic",
"control.deviceName|block": "device name",
"control.deviceSerialNumber|block": "device serial number",
"control.eventSourceId|block": "%id",
"control.eventTimestamp|block": "event timestamp",
"control.eventValueId|block": "%id",
"control.eventValue|block": "event value",
"control.inBackground|block": "run in background",
"control.onEvent|block": "on event|from %src=control_event_source_id|with value %value=control_event_value_id",
"control.raiseEvent|block": "raise event|from source %src=control_event_source_id|with value %value=control_event_value_id",
"control.reset|block": "reset",
"control.waitMicros|block": "wait (µs)%micros",
"control|block": "control",
"game.addScore|block": "change score by|%points",
"game.createSprite|block": "create sprite at|x: %x|y: %y",
"game.gameOver|block": "game over",
"game.score|block": "score",
"game.startCountdown|block": "start countdown|(ms) %duration",
@ -46,6 +64,10 @@
"led.toggle|block": "toggle|x %x|y %y",
"led.unplot|block": "unplot|x %x|y %y",
"led|block": "led",
"motors.dualMotorPower|block": "motor %motor|at %percent",
"motors.motorCommand|block": "motor %command",
"motors.motorPower|block": "motor on at %percent",
"motors|block": "motors",
"music.beat|block": "%fraction|beat",
"music.changeTempoBy|block": "change tempo by (bpm)|%value",
"music.noteFrequency|block": "%note",
@ -65,11 +87,13 @@
"pins.map|block": "map %value|from low %fromLow|from high %fromHigh|to low %toLow|to high %toHigh",
"pins.onPulsed|block": "on|pin %pin|pulsed %pulse",
"pins.pulseDuration|block": "pulse duration (µs)",
"pins.pulseIn|block": "pulse in (µs)|pin %name|pulsed %value",
"pins.servoSetPulse|block": "servo set pulse|pin %value|to (µs) %micros",
"pins.servoWritePin|block": "servo write|pin %name|to %value",
"pins.setPull|block": "set pull|pin %pin|to %pull",
"pins.spiWrite|block": "spi write %value",
"pins|block": "pins",
"serial.delimiters|block": "%del",
"serial.readLine|block": "serial|read line",
"serial.readUntil|block": "serial|read until %delimiter=serial_delimiter_conv",
"serial.redirect|block": "serial|redirect to|TX %tx|RX %rx|at baud rate %rate",
@ -85,7 +109,10 @@
"{id:category}Input": "Input",
"{id:category}Led": "Led",
"{id:category}Math": "Math",
"{id:category}Motors": "Motors",
"{id:category}Music": "Music",
"{id:category}Pins": "Pins",
"{id:category}Serial": "Serial"
"{id:category}Serial": "Serial",
"{id:category}String": "String",
"{id:category}Text": "Text"
}

View File

@ -1,166 +1,175 @@
{
"Math.randomBoolean":"Génère une valeur « true » ou « false » au hasard, tout comme le retournement dune pièce de monnaie.",
"String.fromCharCode":"Faire une chaîne de la donnée code de caractères ASCII.",
"basic":"Permet daccéder aux fonctionnalités de base micro : bit.",
"basic.clearScreen":"Désactiver toutes les LEDs",
"basic.forever":"Répète le code pour toujours en arrière-plan. À chaque itération, permet aux autres codes dexécuter.",
"basic.pause":"Pause pendant la durée spécifiée en millisecondes",
"basic.pause|param|ms":"Combien de temps pour faire une pause pour, par exemple : 100, 200, 500, 1000, 2000",
"basic.plotLeds":"Dessine une image sur lécran LED.",
"basic.plotLeds|param|leds":"modèle de LED à allumer\/éteindre",
"basic.showAnimation":"Montre une séquence décrans LED comme une animation.",
"basic.showAnimation|param|interval":"temps en millisecondes entre chaque rafraîchissement",
"basic.showAnimation|param|leds":"modèle de LED à allumer\/éteindre",
"basic.showLeds":"Dessine une image sur lécran LED.",
"basic.showLeds|param|interval":"temps en millisecondes pour faire une pause après dessin",
"basic.showLeds|param|leds":"le modèle de LED pour activer\/désactiver",
"basic.showNumber":"Mettez en surbrillance un numéro sur lécran. Si le numéro sinscrit sur lécran (c'est-à-dire un seul chiffre), ne défilent pas.",
"basic.showNumber|param|interval":"Vitesse de défilement ; par exemple : -100, 200, 100, 150",
"basic.showString":"Afficher du texte à lécran, un caractère à la fois. Si la chaîne sinscrit sur lécran (c'est-à-dire une lettre), ne défile pas.",
"basic.showString|param|interval":"quelle vitesse de déplacement des personnages ; par exemple : -100, 200, 100, 150",
"basic.showString|param|text":"le texte à faire défiler sur lécran, par exemple : « Bonjour ! »",
"control":"Utilitaires dexécution et événements.",
"control.inBackground":"Horaires du code qui sexécutent en arrière-plan.",
"control.reset":"Réinitialise le BBC micro : bit.",
"game":"Un moteur de jeu unique-LED sprite",
"game.addScore":"Ajoute des points pour le score actuel",
"game.addScore|param|points":"nombre de points à changer, par exemple : 1",
"game.gameOver":"Affiche un jeu au dessus de lanimation.",
"game.score":"Obtient le score actuel",
"game.setScore":"Définit la valeur actuelle de la partition",
"game.setScore|param|value":"TODO",
"game.startCountdown":"Commence un compte à rebours jeu",
"game.startCountdown|param|ms":"durée du compte à rebours en millisecondes, par exemple : 10000",
"images":"Création, manipulation et affichage dimages LED.",
"images.createBigImage":"Crée une image avec 2 images.",
"images.createImage":"Crée une image qui sadapte à lécran LED.",
"input":"Événements et des données provenant de capteurs",
"input.acceleration":"Obtenir la valeur de laccélération en milli-gravitys (lorsque le jury pose plat avec lécran vers le haut, x = 0, y = 0 et z =-1024)",
"input.acceleration|param|dimension":"TODO",
"input.buttonIsPressed":"Obtenir létat du bouton (pressé ou non) pour '' A'' et '' B''.",
"input.calibrate":"Obsolète, boussole de calibrage est automatique.",
"input.compassHeading":"Obtenir le cap compas boussole actuel en degrés.",
"input.lightLevel":"Lit le niveau de lumière appliqué à lécran LED dans une gamme de '' 0'' (noir) à 255 '''' lumineux.",
"input.magneticForce":"Obtenir la valeur de la force magnétique dans '' micro-Teslas'' ('' µT''). Cette fonction nest pas pris en charge dans le simulateur.",
"input.magneticForce|param|dimension":"TODO",
"input.onButtonPressed":"Faire quelque chose quand vous appuyez sur un bouton ('' A'', '' B'' ou les deux '' A + B'')",
"input.onButtonPressed|param|body":"TODO",
"input.onButtonPressed|param|button":"TODO",
"input.onGesture":"Attache le code à exécuter lorsque lécran vers le haut.",
"input.onGesture|param|body":"TODO",
"input.onLogoDown":"Attache le code à exécuter lorsque le logo est orienté vers le bas et le jury est vertical.",
"input.onLogoDown|param|body":"TODO",
"input.onLogoUp":"Attache le code à exécuter lorsque le logo est orienté vers le haut et le jury est vertical.",
"input.onLogoUp|param|body":"TODO",
"input.onPinPressed":"Faire quelque chose lorsque vous appuyez sur une broche ('' P0'', '' P1'' ou les deux '' P2'').",
"input.onPinPressed|param|body":"TODO",
"input.onPinPressed|param|name":"TODO",
"input.onScreenDown":"Attache le code à exécuter lorsque lécran vers le bas.",
"input.onScreenDown|param|body":"TODO",
"input.onScreenUp":"Attache le code à exécuter lorsque lécran vers le haut.",
"input.onScreenUp|param|body":"TODO",
"input.onShake":"Attache le code à exécuter lorsque lappareil est secoué.",
"input.onShake|param|body":"TODO",
"input.pinIsPressed":"Obtenir létat de la broche (pressé ou non). Nécessite de tenir au sol pour fermer le circuit.",
"input.pinIsPressed|param|name":"broche utilisée pour détecter le toucher",
"input.rotation":"La hauteur de lappareil, rotation sur axe le '' x '', en degrés.",
"input.rotation|param|kind":"TODO",
"input.runningTime":"Obtient le nombre de millisecondes écoulées depuis le pouvoir sur.",
"input.setAccelerometerRange":"Définit la plage déchantillon accéléromètre de gravités.",
"input.setAccelerometerRange|param|range":"une valeur décrivent lassurer une rigidité maximale daccélération mesurée",
"input.temperature":"Obtient la température en Celsius degrés (° C).",
"led":"Contrôle de lécran LED.",
"led.brightness":"Descendre la luminosité de lécran de 0 () à 255 (pleine intensité).",
"led.fadeIn":"Fondu dans laffichage à lécran.",
"led.fadeIn|param|ms":"TODO",
"led.fadeOut":"Sévanouit la luminosité de lécran.",
"led.fadeOut|param|ms":"TODO",
"led.plot":"Allumer la LED spécifiée par x, y coordonnées (x est horizontal, y est verticale). (0,0) est en haut à gauche.",
"led.plotAll":"Tous les voyants sallume",
"led.plotBarGraph":"Affiche un graphique à barres vertical basé sur la « valeur » et la valeur « élevée ».\nSi « élevé » est 0, le tableau sajuste automatiquement.",
"led.plotBarGraph|param|high":"valeur maximale. Si 0, la valeur maximale ramenée automatiquement, par exemple : 0",
"led.plotBarGraph|param|value":"valeur actuelle pour tracer",
"led.plot|param|x":"TODO",
"led.plot|param|y":"TODO",
"led.point":"Obtenir lÉtat marche\/arrêt de la LED spécifiée par x, y coordonnées. (0,0) est en haut à gauche.",
"led.point|param|x":"TODO",
"led.point|param|y":"TODO",
"led.screenshot":"Prend une capture décran de lécran LED et renvoie une image.",
"led.setBrightness":"Régler la luminosité de lécran de 0 (off) à 255 (pleine intensité).",
"led.setBrightness|param|value":"valeur de la luminosité, par exemple : 255, 127, 0",
"led.setDisplayMode":"Définit le mode daffichage entre noir et blanc et gris pour le rendu des LEDs.",
"led.setDisplayMode|param|mode":"TODO",
"led.stopAnimation":"Annule lanimation actuelle et efface les autres en attente danimations.",
"led.toggle":"Active\/désactive un pixel particulier",
"led.toggleAll":"Inverse laffichage actuel",
"led.toggle|param|x":"TODO",
"led.toggle|param|y":"TODO",
"led.unplot":"Éteindre la LED spécifiée par x, y coordonnées (x est horizontal, y est verticale). (0,0) est en haut à gauche.",
"led.unplot|param|x":"TODO",
"led.unplot|param|y":"TODO",
"music":"Génération de sonneries musicales via broche '' P0''.",
"music.beat":"Retourne la durée dun battement en milli-secondes",
"music.changeTempoBy":"Changer le tempo de la quantité spécifiée",
"music.changeTempoBy|param|bpm":"Le changement en battements par minute au tempo, par exemple : 20",
"music.noteFrequency":"Obtient la fréquence dune note.",
"music.noteFrequency|param|name":"le nom de la note",
"music.playTone":"Joue une tonalité via broche '' P0'' pour la durée donnée.",
"music.playTone|param|frequency":"hauteur de la tonalité pour jouer en Hertz (Hz)",
"music.playTone|param|ms":"durée de la tonalité en millisecondes (ms)",
"music.rest":"Repose (joue rien) pendant une durée spécifiée via broche '' P0''.",
"music.rest|param|ms":"reposer la durée en millisecondes (ms)",
"music.ringTone":"Joue une tonalité via broche '' P0''.",
"music.ringTone|param|frequency":"hauteur de la tonalité pour jouer en Hertz (Hz)",
"music.setTempo":"Définit le tempo à la quantité spécifiée",
"music.setTempo|param|bpm":"Le nouveau tempo en battements par minute, par exemple : 120",
"music.tempo":"Retourne le tempo en battements par minute. Tempo est la vitesse (bpm = battements par minute) à qui jouent des notes. Plus la valeur du tempo, plus vite les notes jouera.",
"pins":"Contrôle des courants à Pins pour signaux analogiques\/numériques, servos, i2c...",
"pins.analogPitch":"Émet un signal de modulation (PWM) de largeur dimpulsion à laxe de tangage actuelle. Utilisez « analog set axe de tangage » pour définir laxe de tangage.",
"pins.analogPitch|param|frequency":"TODO",
"pins.analogPitch|param|ms":"TODO",
"pins.analogReadPin":"Lire la valeur de connecteur analogique, c'est-à-dire comme une valeur comprise entre 0 et 1023.",
"pins.analogReadPin|param|name":"broche décrire à",
"pins.analogSetPeriod":"Configure la modulation de largeur dimpulsion (PWM) de la sortie à la valeur donnée en analogique ** microsecondes ** ou « 1\/1000' millisecondes.\nSi cette broche nest pas configurée comme un analogue de sortie (en utilisant « écriture analogique pin »), lopération na aucun effet.",
"pins.analogSetPeriod|param|micros":"période en micro secondes. par exemple : 20000",
"pins.analogSetPeriod|param|name":"broche analogique pour définir le délai",
"pins.analogSetPitchPin":"Définit laxe utilisé lors de lutilisation de « pins-> pitch analogique ».",
"pins.analogSetPitchPin|param|name":"TODO",
"pins.analogWritePin":"Définissez la valeur de connecteur analogique. Valeur doit être comprise entre 0 et 1023.",
"pins.analogWritePin|param|name":"nom de la broche décrire à",
"pins.analogWritePin|param|value":"valeur à écrire sur la broche entre '' 0'' et '' 1023''. par exemple : 1023, 0",
"pins.digitalReadPin":"Lire la broche spécifié ou le connecteur comme 0 ou 1",
"pins.digitalReadPin|param|name":"broche pour lire à partir",
"pins.digitalWritePin":"Définir une valeur de code pin ou le connecteur à 0 ou 1.",
"pins.digitalWritePin|param|name":"broche décrire à",
"pins.digitalWritePin|param|value":"valeur à définir sur la broche, 1 par exemple, 0",
"pins.i2cReadNumber":"Lire un numéro de 7-bit I2C adresse.",
"pins.i2cWriteNumber":"Écrire un nombre à une adresse I2C de 7 bits.",
"pins.map":"Remappe un nombre dune plage à lautre. Autrement dit, une valeur '' de faible '' serait sont mappée aux '' à faible '', une valeur de '' de haut '' à '' à haute '', valeurs intermédiaires à etc in-between, de valeurs.",
"pins.map|param|fromHigh":"limite la supérieure de la gamme actuelle de la valeur, par exemple : 1023",
"pins.map|param|fromLow":"la limite inférieure de la gamme actuelle de la valeur",
"pins.map|param|toHigh":"la limite supérieure de la cible de la valeur du rang, par exemple : 4",
"pins.map|param|toLow":"la limite inférieure de la fourchette cible de la valeur",
"pins.map|param|value":"valeur à la carte dans les rangs",
"pins.onPulsed":"Configure cette broche pour une entrée numérique et génère des événements où lhorodatage est la durée pendant laquelle cette broche a été '' élevé '' ou '' faible ''.",
"pins.pulseDuration":"Obtient la durée de la dernière impulsion en microsecondes. Cette fonction doit être appelée à partir dun gestionnaire de '' onPulsed''.",
"pins.servoSetPulse":"Configure cette broche e\/s comme une sortie analogique\/pwm, configure le laps de temps pour être 20 ms et définit la largeur dimpulsion, basée sur la valeur, il est donné ** microsecondes ** ou « 1\/1000' millisecondes.",
"pins.servoSetPulse|param|micros":"durée de limpulsion en micro secondes, par exemple : 1500",
"pins.servoSetPulse|param|name":"nom de code PIN",
"pins.servoWritePin":"Écrit une valeur à lasservissement, contrôle de larbre en conséquence. Sur un servo standard, cette fonction définira langle de larbre (en degrés), déplacer larbre à cette orientation. Sur un servo de rotation continue, cette fonction définira la vitesse du servo (avec '' 0'' en pleine vitesse dans une seule direction, '' 180'' en pleine vitesse dans lautre et une valeur de près de 90 '''' aucun mouvement).",
"pins.servoWritePin|param|name":"broche décrire à",
"pins.servoWritePin|param|value":"angle ou rotation à vitesse, par exemple : 0, 90 et 180",
"pins.setPull":"Configure lattraction de cette broche.",
"pins.setPull|param|name":"broche pour définir le mode de traction sur",
"pins.setPull|param|pull":"une des configurations mbed pull : PullUp, menu déroulant, PullNone ",
"serial":"Lire et écrire des données sur une connexion série.",
"serial.readLine":"Lit une ligne de texte à partir du port série.",
"serial.redirect":"Configuration dynamique de linstance de série pour utiliser des épingles autres que USBTX et USBRX.",
"serial.redirect|param|rx":"le nouveau NIP de réception",
"serial.redirect|param|tx":"les nouvelles goupilles de transmission",
"serial.writeLine":"Imprime une ligne de texte pour le numéro de série",
"serial.writeNumber":"Imprime une valeur numérique de la série",
"serial.writeString":"Envoie un morceau de texte via la connexion série.",
"serial.writeValue":"Écrit un « nom : valeur '' paire de ligne de la série.",
"serial.writeValue|param|name":"nom de la valeur stream, par exemple : x",
"serial.writeValue|param|value":"Écrire"
"Math.randomBoolean": "Génère une valeur « true » ou « false » au hasard, comme si vous lanciez une pièce de monnaie.",
"String.fromCharCode": "",
"basic": "",
"basic.clearScreen": "",
"basic.forever": "Répète le code indéfiniment en tâche de fond. A chaque itération, permet aux autres codes de sexécuter.",
"basic.pause": "Pause pendant la durée indiquée en millisecondes",
"basic.pause|param|ms": "",
"basic.plotLeds": "",
"basic.plotLeds|param|leds": "",
"basic.showAnimation": "",
"basic.showAnimation|param|interval": "",
"basic.showAnimation|param|leds": "",
"basic.showLeds": "",
"basic.showLeds|param|interval": "",
"basic.showLeds|param|leds": "",
"basic.showNumber": "",
"basic.showNumber|param|interval": "",
"basic.showString": "",
"basic.showString|param|interval": "",
"basic.showString|param|text": "",
"control": "",
"control.inBackground": "",
"control.reset": "",
"control.waitMicros": "",
"control.waitMicros|param|micros": "",
"game": "",
"game.addScore": "",
"game.addScore|param|points": "",
"game.gameOver": "",
"game.score": "",
"game.setScore": "",
"game.setScore|param|value": "",
"game.startCountdown": "",
"game.startCountdown|param|ms": "",
"images": "",
"images.createBigImage": "",
"images.createImage": "",
"input": "",
"input.acceleration": "",
"input.acceleration|param|dimension": "",
"input.buttonIsPressed": "",
"input.calibrate": "",
"input.compassHeading": "",
"input.lightLevel": "",
"input.magneticForce": "",
"input.magneticForce|param|dimension": "",
"input.onButtonPressed": "",
"input.onButtonPressed|param|body": "",
"input.onButtonPressed|param|button": "",
"input.onGesture": "",
"input.onGesture|param|body": "",
"input.onLogoDown": "",
"input.onLogoDown|param|body": "",
"input.onLogoUp": "",
"input.onLogoUp|param|body": "",
"input.onPinPressed": "",
"input.onPinPressed|param|body": "",
"input.onPinPressed|param|name": "",
"input.onPinReleased": "",
"input.onPinReleased|param|body": "",
"input.onPinReleased|param|name": "",
"input.onScreenDown": "",
"input.onScreenDown|param|body": "",
"input.onScreenUp": "",
"input.onScreenUp|param|body": "",
"input.onShake": "",
"input.onShake|param|body": "",
"input.pinIsPressed": "",
"input.pinIsPressed|param|name": "",
"input.rotation": "",
"input.rotation|param|kind": "",
"input.runningTime": "",
"input.setAccelerometerRange": "",
"input.setAccelerometerRange|param|range": "",
"input.temperature": "",
"led": "",
"led.brightness": "",
"led.fadeIn": "",
"led.fadeIn|param|ms": "",
"led.fadeOut": "",
"led.fadeOut|param|ms": "",
"led.plot": "",
"led.plotAll": "",
"led.plotBarGraph": "",
"led.plotBarGraph|param|high": "",
"led.plotBarGraph|param|value": "",
"led.plot|param|x": "",
"led.plot|param|y": "",
"led.point": "",
"led.point|param|x": "",
"led.point|param|y": "",
"led.screenshot": "",
"led.setBrightness": "",
"led.setBrightness|param|value": "",
"led.setDisplayMode": "",
"led.setDisplayMode|param|mode": "",
"led.stopAnimation": "",
"led.toggle": "",
"led.toggleAll": "",
"led.toggle|param|x": "",
"led.toggle|param|y": "",
"led.unplot": "",
"led.unplot|param|x": "",
"led.unplot|param|y": "",
"music": "",
"music.beat": "",
"music.changeTempoBy": "",
"music.changeTempoBy|param|bpm": "",
"music.noteFrequency": "",
"music.noteFrequency|param|name": "",
"music.playTone": "",
"music.playTone|param|frequency": "",
"music.playTone|param|ms": "",
"music.rest": "Repose (joue rien) pendant une durée spécifiée via broche '' P0''.",
"music.rest|param|ms": "",
"music.ringTone": "",
"music.ringTone|param|frequency": "",
"music.setTempo": "",
"music.setTempo|param|bpm": "",
"music.tempo": "",
"pins": "",
"pins.analogPitch": "",
"pins.analogPitch|param|frequency": "",
"pins.analogPitch|param|ms": "",
"pins.analogReadPin": "",
"pins.analogReadPin|param|name": "",
"pins.analogSetPeriod": "",
"pins.analogSetPeriod|param|micros": "",
"pins.analogSetPeriod|param|name": "",
"pins.analogSetPitchPin": "",
"pins.analogSetPitchPin|param|name": "",
"pins.analogWritePin": "",
"pins.analogWritePin|param|name": "",
"pins.analogWritePin|param|value": "",
"pins.digitalReadPin": "",
"pins.digitalReadPin|param|name": "",
"pins.digitalWritePin": "",
"pins.digitalWritePin|param|name": "",
"pins.digitalWritePin|param|value": "",
"pins.i2cReadNumber": "",
"pins.i2cWriteNumber": "",
"pins.map": "",
"pins.map|param|fromHigh": "",
"pins.map|param|fromLow": "",
"pins.map|param|toHigh": "",
"pins.map|param|toLow": "",
"pins.map|param|value": "",
"pins.onPulsed": "",
"pins.pulseDuration": "",
"pins.servoSetPulse": "",
"pins.servoSetPulse|param|micros": "",
"pins.servoSetPulse|param|name": "",
"pins.servoWritePin": "",
"pins.servoWritePin|param|name": "",
"pins.servoWritePin|param|value": "",
"pins.setPull": "",
"pins.setPull|param|name": "",
"pins.setPull|param|pull": "",
"pins.spiWrite": "",
"pins.spiWrite|param|value": "",
"serial": "",
"serial.readLine": "",
"serial.readUntil": "",
"serial.readUntil|param|delimiter": "",
"serial.redirect": "",
"serial.redirect|param|rx": "",
"serial.redirect|param|tx": "",
"serial.writeLine": "",
"serial.writeNumber": "",
"serial.writeString": "",
"serial.writeValue": "",
"serial.writeValue|param|name": "",
"serial.writeValue|param|value": ""
}

View File

@ -0,0 +1,91 @@
{
"Math.randomBoolean|block": "choisir au hasard vrai ou faux",
"Math|block": "Maths",
"String.fromCharCode|block": "texte du code de charactère %code",
"String|block": "Texte",
"basic.clearScreen|block": "effacer lécran",
"basic.forever|block": "toujours",
"basic.pause|block": "pause (ms) %pause",
"basic.showLeds|block": "montrer LEDs",
"basic.showNumber|block": "montrer|nombre %number",
"basic.showString|block": "montrer|texte %text",
"basic|block": "base",
"control.inBackground|block": "exécuter en arrière-plan",
"control.reset|block": "remise à zéro",
"control.waitMicros|block": "attendre (µs) %micros",
"control|block": "contrôle",
"game.addScore|block": "changer le score par|%points",
"game.gameOver|block": "fin du jeu",
"game.score|block": "score",
"game.startCountdown|block": "commencer compte à rebours|(ms) %duration",
"game|block": "jeu",
"images.createBigImage|block": "créer grande image",
"images.createImage|block": "créer image",
"images|block": "images",
"input.acceleration|block": "accélération (mg) |%NAME",
"input.buttonIsPressed|block": "button|%NAME|est pressé",
"input.compassHeading|block": "direction de la boussole (°)",
"input.lightLevel|block": "niveau dintensité lumineuse",
"input.magneticForce|block": "force magnétique (µT) |%NAME",
"input.onButtonPressed|block": "lorsque le button|%NAME|est pressé",
"input.onGesture|block": "lorsque|%NAME",
"input.onPinPressed|block": "lorsque le pin %NAME|est pressé",
"input.onPinReleased|block": "lorsque la broche %NAME|est lachée",
"input.pinIsPressed|block": "broche %NAME| est pressée",
"input.rotation|block": "rotation (°)|%NAME",
"input.runningTime|block": "temps dexécution (ms)",
"input.setAccelerometerRange|block": "spécifier|la gamme de l'acceleromètre %range",
"input.temperature|block": "température (° C)",
"input|block": "entrées",
"led.brightness|block": "luminosité",
"led.plotBarGraph|block": "tracer le graphe de %valeur|à %high",
"led.plot|block": "allumer|x %x|y %y",
"led.point|block": "allumée à|x %x|y %y",
"led.setBrightness|block": "spécifier la luminosité %value",
"led.stopAnimation|block": "arrêter lanimation",
"led.toggle|block": "activer/désactiver|x %x|y %y",
"led.unplot|block": "éteindre|x %x|y %y",
"led|block": "LED",
"music.beat|block": "%fraction|de mesure",
"music.changeTempoBy|block": "changer le tempo par (bpm) | %value",
"music.noteFrequency|block": "%note",
"music.playTone|block": "jouer|ton %note=device_note|pendant %duration=device_beat",
"music.rest|block": "repos (ms) |%duration=device_beat",
"music.ringTone|block": "buzz (Hz)|%note=device_note",
"music.setTempo|block": "régler le tempo à (bpm)|%valeur",
"music.tempo|block": "tempo (bpm)",
"music|block": "musique",
"pins.analogReadPin|block": "lire|la broche analogique %name",
"pins.analogSetPeriod|block": "",
"pins.analogWritePin|block": "",
"pins.digitalReadPin|block": "lire en numérique|broche %name",
"pins.digitalWritePin|block": "écrire en numérique|la broche %name|%value",
"pins.i2cReadNumber|block": "i2c lire nombre|à ladresse %address|de format %format=i2c_sizeof",
"pins.i2cWriteNumber|block": "i2c écrire nombre|à ladresse %address|avec value %value|de format %format=i2c_sizeof",
"pins.map|block": "",
"pins.onPulsed|block": "lorsque|la broche %pin|est pulsée %pulse",
"pins.pulseDuration|block": "durée de limpulsion (µs)",
"pins.servoSetPulse|block": "",
"pins.servoWritePin|block": "servo écrire|broche %name|à %value",
"pins.setPull|block": "",
"pins.spiWrite|block": "spi écrire %value",
"pins|block": "broches",
"serial.readLine|block": "série|lire ligne",
"serial.readUntil|block": "série|lire jusque %delimiter=serial_delimiter_conv",
"serial.redirect|block": "série|rediriger vers|TX %tx|RX %rx|au débit en baudes %rate",
"serial.writeLine|block": "série|écrire ligne %text",
"serial.writeNumber|block": "série|écrire nombre %value",
"serial.writeString|block": "série|écrire texte %text",
"serial.writeValue|block": "série|écrire valeur %name|= %valeur",
"serial|block": "Communication Série",
"{id:category}Basic": "Basique",
"{id:category}Control": "Contrôle",
"{id:category}Game": "Jeu",
"{id:category}Images": "Images",
"{id:category}Input": "Entrées",
"{id:category}Led": "LED",
"{id:category}Math": "Maths",
"{id:category}Music": "Musique",
"{id:category}Pins": "Broches",
"{id:category}Serial": "Communication Série"
}

18
libs/core/enums.d.ts vendored
View File

@ -240,6 +240,24 @@ declare namespace control {
}
declare namespace led {
}
declare enum MotorCommand {
//% block=coast
Coast = 0,
//% block=break
Break = 1,
//% block=sleep
Sleep = 2,
}
declare enum Motor {
A = 0,
B = 1,
//% block="A and B"
AB = 2,
}
declare namespace motors {
}

View File

@ -1,17 +1,68 @@
#include "ksbit.h"
enum MotorCommand {
//% block=coast
Coast,
//% block=break
Break,
//% block=sleep
Sleep
};
enum Motor {
A,
B,
//% block="A and B"
AB
};
/**
* Blocks to control the onboard motors
*/
//% color=#008272 weight=30
namespace motors {
/**
* Controls the power sent to a single motor
* Turns on the motor at a certain percent of power.
* @param power %percent of power sent to the motor. Negative power goes backward. eg: 50
*/
//% blockId=motor_on block="motor on at %percent|%"
//% parts=dcmotor
void motorOn(int power) {
//% blockId=motor_on block="motor on at %percent"
//% parts=dcmotor weight=90 blockGap=8
void motorPower(int power) {
uBit.soundmotor.Motor_On(power);
}
/**
* Send break, coast or sleep commands to the motor
*/
//% blockId=motor_command block="motor %command"
//% parts=dcmotor weight=85
void motorCommand(MotorCommand command) {
switch(command) {
case MotorCommand::Coast: uBit.soundmotor.Motor_Coast();break;
case MotorCommand::Break: uBit.soundmotor.Motor_Break();break;
case MotorCommand::Sleep: uBit.soundmotor.Motor_Sleep();break;
}
}
/**
* Controls two motors attached to the board.
*/
//% blockId=block_dual_motor block="motor %motor|at %percent"
//% weight=80
void dualMotorPower(Motor motor, int duty_percent) {
switch(motor) {
case Motor::A: if (duty_percent <= 0) uBit.soundmotor.MotorA_Off();
else uBit.soundmotor.MotorA_On(duty_percent); break;
case Motor::B: if (duty_percent <= 0) uBit.soundmotor.MotorB_Off();
else uBit.soundmotor.MotorB_On(duty_percent); break;
case Motor::AB: if (duty_percent <= 0) {
uBit.soundmotor.MotorA_Off();
uBit.soundmotor.MotorB_Off();
} else {
uBit.soundmotor.MotorA_On(duty_percent);
uBit.soundmotor.MotorB_On(duty_percent);
}
break;
}
}
}

View File

@ -9,8 +9,8 @@ namespace music {
//% help=music/play-tone weight=90
//% blockId=device_play_note block="play|tone %note=device_note|for %duration=device_beat" icon="\uf025" blockGap=8
//% parts="speaker" async
void playTone(int freqency, int ms) {
uBit.soundmotor.Sound_On(freqency);
void playTone(int frequency, int ms) {
uBit.soundmotor.Sound_On(frequency);
if(ms > 0) uBit.sleep(ms);
uBit.soundmotor.Sound_Off();
}

View File

@ -129,31 +129,6 @@ enum BeatFraction {
namespace music {
let beatsPerMinute: number = 120;
// /**
// * Plays a tone through pin ``P0`` for the given duration.
// * @param frequency pitch of the tone to play in Hertz (Hz)
// * @param ms tone duration in milliseconds (ms)
// */
// //% help=music/play-tone weight=90
// //% blockId=device_play_note block="play|tone %note=device_note|for %duration=device_beat" icon="\uf025" blockGap=8
// //% parts="speaker"
// export function playTone(frequency: number, ms: number): void {
// pins.analogSetPitchPin(AnalogPin.P0);
// pins.analogPitch(frequency, ms);
// }
//
// /**
// * Plays a tone through pin ``P0``.
// * @param frequency pitch of the tone to play in Hertz (Hz)
// */
// //% help=music/ring-tone weight=80
// //% blockId=device_ring block="ring tone (Hz)|%note=device_note" icon="\uf025" blockGap=8
// //% parts="speaker"
// export function ringTone(frequency: number): void {
// pins.analogSetPitchPin(AnalogPin.P0);
// pins.analogPitch(frequency, 0);
// }
/**
* Rests (plays nothing) for a specified time through pin ``P0``.
* @param ms rest duration in milliseconds (ms)

24
libs/core/shims.d.ts vendored
View File

@ -524,12 +524,26 @@ declare namespace led {
declare namespace motors {
/**
* Controls the power sent to a single motor
* Turns on the motor at a certain percent of power.
* @param power %percent of power sent to the motor. Negative power goes backward. eg: 50
*/
//% blockId=motor_on block="motor on at %percent|%"
//% parts=dcmotor shim=motors::motorOn
function motorOn(power: number): void;
//% blockId=motor_on block="motor on at %percent"
//% parts=dcmotor weight=90 blockGap=8 shim=motors::motorPower
function motorPower(power: number): void;
/**
* Send break, coast or sleep commands to the motor
*/
//% blockId=motor_command block="motor %command"
//% parts=dcmotor weight=85 shim=motors::motorCommand
function motorCommand(command: MotorCommand): void;
/**
* Controls two motors attached to the board.
*/
//% blockId=block_dual_motor block="motor %motor|at %percent"
//% weight=80 shim=motors::dualMotorPower
function dualMotorPower(motor: Motor, duty_percent: number): void;
}
declare namespace music {
@ -541,7 +555,7 @@ declare namespace music {
//% help=music/play-tone weight=90
//% blockId=device_play_note block="play|tone %note=device_note|for %duration=device_beat" icon="\uf025" blockGap=8
//% parts="speaker" async shim=music::playTone
function playTone(freqency: number, ms: number): void;
function playTone(frequency: number, ms: number): void;
/**
* Plays a tone through ``speaker``.

View File

@ -1,13 +1,16 @@
{
"radio": "Communicate data using radio packets",
"radio.onDataPacketReceived": "Registers code to run when the radio receives a packet. Also takes the\nreceived packet from the radio queue.",
"radio.onDataReceived": "Registers code to run when a packet is received over radio.",
"radio.receiveNumber": "Reads the next packet as a number from the radio queue.",
"radio.receiveString": "Reads the next packet as a string and returns it.",
"radio.receivedNumberAt": "Reads a number at a given index, between ``0`` and ``3``, from the packet received by ``receive number``. Not supported in simulator.",
"radio.receivedNumberAt|param|index": "index of the number to read from 0 to 3. 1 eg",
"radio.receivedSignalStrength": "Gets the received signal strength indicator (RSSI) from the packet received by ``receive number``. Not supported in simulator.\nnamespace=radio",
"radio.receiveNumber": "Reads the next packet from the radio queue and returns the packet's number\npayload or 0 if the packet did not contain a number.",
"radio.receiveString": "Reads the next packet from the radio queue and returns the packet's string\npayload or the empty string if the packet did not contain a string.",
"radio.receivedNumber": "Returns the number payload from the last packet taken from the radio queue\n(via ``receiveNumber``, ``receiveString``, etc) or 0 if that packet did not\ncontain a number.",
"radio.receivedSerial": "Returns the serial number of the sender micro:bit from the last packet taken\nfrom the radio queue (via ``receiveNumber``, ``receiveString``, etc) or 0 if\nthat packet did not send a serial number.",
"radio.receivedSignalStrength": "Gets the received signal strength indicator (RSSI) from the last packet taken\nfrom the radio queue (via ``receiveNumber``, ``receiveString``, etc). Not supported in simulator.\nnamespace=radio",
"radio.receivedString": "Returns the string payload from the last packet taken from the radio queue\n(via ``receiveNumber``, ``receiveString``, etc) or the empty string if that\npacket did not contain a string.",
"radio.receivedTime": "Returns the system time of the sender micro:bit at the moment when it sent the\nlast packet taken from the radio queue (via ``receiveNumber``,\n``receiveString``, etc).",
"radio.sendNumber": "Broadcasts a number over radio to any connected micro:bit in the group.",
"radio.sendString": "Broadcasts a number over radio to any connected micro:bit in the group.",
"radio.sendString": "Broadcasts a string along with the device serial number\nand running time to any connected micro:bit in the group.",
"radio.sendValue": "Broadcasts a name / value pair along with the device serial number\nand running time to any connected micro:bit in the group.",
"radio.sendValue|param|name": "the field name (max 12 characters), eg: \"data\"",
"radio.sendValue|param|value": "the numberic value",
@ -16,5 +19,5 @@
"radio.setTransmitPower|param|power": "a value in the range 0..7, where 0 is the lowest power and 7 is the highest. eg: 7",
"radio.setTransmitSerialNumber": "Set the radio to transmit the serial number in each message.",
"radio.setTransmitSerialNumber|param|transmit": "value indicating if the serial number is transmitted, eg: true",
"radio.writeValueToSerial": "Reads a value sent with `stream value` and writes it\nto the serial stream as JSON"
"radio.writeValueToSerial": "Reads the next packet from the radio queue and and writes it to serial\nas JSON."
}

View File

@ -1,4 +1,5 @@
{
"radio.onDataPacketReceived|block": "on radio received",
"radio.onDataReceived|block": "radio on data received",
"radio.receiveNumber|block": "radio receive number",
"radio.receiveString|block": "radio receive string",

View File

@ -1,6 +1,6 @@
{
"name": "pxt-calliope",
"version": "0.5.56",
"version": "0.5.69",
"description": "calliope target for PXT",
"keywords": [
"JavaScript",
@ -30,7 +30,7 @@
"typescript": "^1.8.7"
},
"dependencies": {
"pxt-core": "0.5.34",
"pxt-core": "0.5.61",
"less": "^2.6.0",
"semantic-ui-less": "^2.2.4"
}

View File

@ -180,13 +180,13 @@
"appTheme": {
"accentColor": "#249899",
"defaultLocale": "de",
"logoUrl": "https://calliope.cc/about",
"logoUrl": "https://calliope.cc/",
"logo": "./static/Calliopeminieditor.svg",
"docsLogo": "./static/Calliopeminieditor.svg",
"docsLogo": "./static/Logo_Calliope_Woman.svg",
"portraitLogo": "./static/Logo_Calliope_Woman.svg",
"footerLogo": "./static/Calliopeminieditor.svg",
"cardLogo": "https://az851932.vo.msecnd.net/pub/drbwxcth",
"appLogo": "https://az851932.vo.msecnd.net/pub/tbhemtig",
"cardLogo": "./static/icons/apple-touch-icon.png",
"appLogo": "./static/icons/apple-touch-icon.png",
"homeUrl": "https://calliope.cc/",
"privacyUrl": "https://go.microsoft.com/fwlink/?LinkId=521839",
"termsOfUseUrl": "https://go.microsoft.com/fwlink/?LinkID=206977",

View File

@ -1,5 +1,10 @@
namespace pxsim.motors {
export function motorOn(power: number) {
export function motorPower(power: number) {
// TODO
}
export function motorCommand(command: MotorCommand) {
}
export function dualMotorPower(motor: Motor, percent: number) {
}
}

View File

@ -1723,8 +1723,9 @@ namespace pxsim.visuals {
tiltDecayer = 0;
}
let ax = (ev.clientX - this.element.clientWidth / 2) / (this.element.clientWidth / 3);
let ay = (ev.clientY - this.element.clientHeight / 2) / (this.element.clientHeight / 3);
let bbox = this.element.getBoundingClientRect();
let ax = (ev.clientX - bbox.width / 2) / (bbox.width / 3);
let ay = (ev.clientY - bbox.height / 2) / (bbox.height / 3);
let x = - Math.max(- 1023, Math.min(1023, Math.floor(ax * 1023)));
let y = Math.max(- 1023, Math.min(1023, Math.floor(ay * 1023)));

View File

@ -35,5 +35,8 @@
PXT Overrides
*******************************/
@mainMenuHeight: 5rem;
@mobileMenuHeight: 5rem;
@blocklyToolboxColor: #F6F4E6;

View File

@ -1,5 +1,6 @@
/* Import all components */
@import 'semantic';
@import 'pxt';
@import 'themes/default/globals/site.variables';
@import 'themes/pxt/globals/site.variables';
@import 'site/globals/site.variables';