Upgrades (#14)

* enable tracing

* more config adjustments

* upgrading images

* upgrading input

* upgrading led

* upgraded pins api

* upgrade runtime

* upgrading pxt.h

* upgrading basic.cpp

* upgraded control

* upgraded control.ts

* upgrading core.cpp

* updating shims

* fixing merge issues

* upgrading BLE config
This commit is contained in:
Peli de Halleux
2017-12-14 11:00:47 -08:00
committed by GitHub
parent a1f1911eb0
commit 2250aa9d4b
16 changed files with 854 additions and 318 deletions

View File

@ -58,6 +58,7 @@
"EventCreationMode": "How to create the event.",
"EventCreationMode.CreateAndFire": "MicroBitEvent is initialised, and its event handlers are immediately fired (not suitable for use in interrupts!).",
"EventCreationMode.CreateOnly": "MicroBitEvent is initialised, and no further processing takes place.",
"Gesture.EightG": "Raised when a 8G shock is detected",
"Gesture.FreeFall": "Raised when the board is falling!",
"Gesture.LogoDown": "Raised when the logo is downward and the screen is vertical",
"Gesture.LogoUp": "Raised when the logo is upward and the screen is vertical",
@ -167,13 +168,14 @@
"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.LedSprite": "A game sprite rendered as a single LED",
"game.LedSprite.blink": "Reports the ``blink`` duration of a sprite",
"game.LedSprite.brightness": "Reports the ``brightness` of a sprite on the LED screen",
"game.LedSprite.change": "Changes a property of the sprite",
"game.LedSprite.changeBlinkBy": "Changes the ``blink`` duration by the given amount of millisecons",
"game.LedSprite.changeBlinkBy|param|ms": "TODO",
"game.LedSprite.changeBrightnessBy": "Changes the ``y`` position by the given amount",
"game.LedSprite.changeBrightnessBy|param|value": "TODO",
"game.LedSprite.changeBrightnessBy|param|value": "the value to change brightness",
"game.LedSprite.changeDirectionBy": "Changes the ``direction`` position by the given amount by turning right",
"game.LedSprite.changeDirectionBy|param|angle": "TODO",
"game.LedSprite.changeXBy": "Changes the ``x`` position by the given amount",
@ -182,19 +184,18 @@
"game.LedSprite.changeYBy|param|y": "TODO",
"game.LedSprite.change|param|property": "the name of the property to change",
"game.LedSprite.change|param|value": "amount of change, eg: 1",
"game.LedSprite.delete": "Deletes the sprite from the game engine. All further operation of the sprite will not have any effect.",
"game.LedSprite.delete|param|sprite": "TODO",
"game.LedSprite.delete": "Deletes the sprite from the game engine. The sprite will no longer appear on the screen or interact with other sprites.",
"game.LedSprite.direction": "Reports the current direction of a sprite",
"game.LedSprite.get": "Gets a property of the sprite",
"game.LedSprite.get|param|property": "the name of the property to change",
"game.LedSprite.goTo": "Go to this position on the screen",
"game.LedSprite.goTo|param|x": "TODO",
"game.LedSprite.goTo|param|y": "TODO",
"game.LedSprite.ifOnEdgeBounce": "If touching the edge of the stage, then bounce away.",
"game.LedSprite.isTouching": "Reports true if sprite is touching specified sprite",
"game.LedSprite.ifOnEdgeBounce": "If touching the edge of the stage and facing towards it, then turn away.",
"game.LedSprite.isTouching": "Reports true if sprite has the same position as specified sprite",
"game.LedSprite.isTouchingEdge": "Reports true if sprite is touching an edge",
"game.LedSprite.isTouching|param|other": "TODO",
"game.LedSprite.move": "Move a certain number of LEDs",
"game.LedSprite.move": "Move a certain number of LEDs in the current direction",
"game.LedSprite.move|param|leds": "number of leds to move, eg: 1, -1",
"game.LedSprite.off": "Turns off the sprite (on by default)",
"game.LedSprite.on": "Turns on the sprite (on by default)",
@ -202,7 +203,7 @@
"game.LedSprite.setBlink": "Sets the blink duration interval in millisecond.",
"game.LedSprite.setBlink|param|ms": "TODO",
"game.LedSprite.setBrightness": "Set the ``brightness`` of a sprite",
"game.LedSprite.setBrightness|param|brightness": "TODO",
"game.LedSprite.setBrightness|param|brightness": "the brightness from 0 (off) to 255 (on), eg: 255.",
"game.LedSprite.setDirection": "Set the direction of the current sprite, rounded to the nearest multiple of 45",
"game.LedSprite.setDirection|param|degrees": "TODO",
"game.LedSprite.setX": "Set the ``x`` position of a sprite",
@ -221,28 +222,31 @@
"game.LedSprite.y": "Reports the ``y`` position of a sprite on the LED screen",
"game.addLife": "Adds life points to the current life",
"game.addLife|param|lives": "TODO",
"game.addScore": "Adds points to the current score",
"game.addScore": "Adds points to the current score and shows an animation",
"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.gameOver": "Displays a game over animation and the score.",
"game.invalidSprite": "Gets an invalid sprite; used to initialize locals.",
"game.isGameOver": "Indicates if the game is display the game over sequence.",
"game.isPaused": "Indicates if the game rendering is paused to allow other animations",
"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.pause": "Pauses the game rendering engine to allow other animations",
"game.removeLife": "Removes some life",
"game.removeLife|param|life": "TODO",
"game.resume": "Resumes the game rendering engine",
"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.setScore|param|value": "new score value.",
"game.showScore": "Displays the score on the screen.",
"game.startCountdown": "Starts a game countdown timer",
"game.startCountdown": "Shows an animation, then starts a game countdown timer, which causes Game Over when it reaches 0",
"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.",
@ -252,26 +256,28 @@
"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)",
"input.acceleration|param|dimension": "TODO",
"input.buttonIsPressed": "Get the button state (pressed or not) for ``A`` and ``B``.",
"input.calibrate": "Obsolete, compass calibration is automatic.",
"input.buttonIsPressed|param|button": "the button to query the request, eg: Button.A",
"input.calibrateCompass": "Obsolete, compass calibration is automatic.",
"input.compassHeading": "Get the current compass heading in degrees.",
"input.lightLevel": "Reads the light level applied to the LED screen in a range from ``0`` (dark) to ``255`` bright.",
"input.magneticForce": "Get the magnetic force value in ``micro-Teslas`` (``µT``). This function is not supported in the simulator.",
"input.magneticForce|param|dimension": "TODO",
"input.onButtonPressed": "Do something when a button (``A``, ``B`` or both ``A+B``) is pressed",
"input.onButtonPressed|param|body": "TODO",
"input.onButtonPressed|param|button": "TODO",
"input.onButtonPressed": "Do something when a button (A, B or both A+B) is pushed down and released again.",
"input.onButtonPressed|param|body": "code to run when event is raised",
"input.onButtonPressed|param|button": "the button that needs to be pressed",
"input.onGesture": "Do something when when a gesture is done (like shaking the micro:bit).",
"input.onGesture|param|body": "TODO",
"input.onGesture|param|body": "code to run when gesture is raised",
"input.onGesture|param|gesture": "the type of gesture to track, eg: Gesture.Shake",
"input.onLogoDown": "Attaches code to run when the logo is oriented downwards and the board is vertical.",
"input.onLogoDown|param|body": "TODO",
"input.onLogoUp": "Attaches code to run when the logo is oriented upwards and the board is vertical.",
"input.onLogoUp|param|body": "TODO",
"input.onPinPressed": "Do something when a pin is pressed.",
"input.onPinPressed": "Do something when a pin is touched and released again (while also touching the GND pin).",
"input.onPinPressed|param|body": "the code to run when the pin is pressed",
"input.onPinPressed|param|name": "the pin that needs to be pressed",
"input.onPinPressed|param|name": "the pin that needs to be pressed, eg: TouchPin.P0",
"input.onPinReleased": "Do something when a pin is released.",
"input.onPinReleased|param|body": "the code to run when the pin is released",
"input.onPinReleased|param|name": "the pin that needs to be released",
"input.onPinReleased|param|name": "the pin that needs to be released, eg: TouchPin.P0",
"input.onScreenDown": "Attaches code to run when the screen is facing down.",
"input.onScreenDown|param|body": "TODO",
"input.onScreenUp": "Attaches code to run when the screen is facing up.",
@ -279,15 +285,17 @@
"input.onShake": "Attaches code to run when the device is shaken.",
"input.onShake|param|body": "TODO",
"input.pinIsPressed": "Get the pin state (pressed or not). Requires to hold the ground to close the circuit.",
"input.pinIsPressed|param|name": "pin used to detect the touch",
"input.pinIsPressed|param|name": "pin used to detect the touch, eg: TouchPin.P0",
"input.rotation": "The pitch or roll of the device, rotation along the ``x-axis`` or ``y-axis``, in degrees.",
"input.rotation|param|kind": "TODO",
"input.runningTime": "Gets the number of milliseconds elapsed since power on.",
"input.runningTimeMicros": "Gets the number of microseconds elapsed since power on.",
"input.setAccelerometerRange": "Sets the accelerometer sample range in gravities.",
"input.setAccelerometerRange|param|range": "a value describe the maximum strengh of acceleration measured",
"input.temperature": "Gets the temperature in Celsius degrees (°C).",
"led": "Control of the LED screen.",
"led.brightness": "Get the screen brightness from 0 (off) to 255 (full bright).",
"led.displayMode": "Gets the current display mode",
"led.enable": "Turns on or off the display",
"led.fadeIn": "Fades in the screen display.",
"led.fadeIn|param|ms": "TODO",
@ -298,8 +306,12 @@
"led.plotBarGraph": "Displays a vertical bar graph based on the `value` and `high` value.\nIf `high` is 0, the chart gets adjusted automatically.",
"led.plotBarGraph|param|high": "maximum value. If 0, maximum value adjusted automatically, eg: 0",
"led.plotBarGraph|param|value": "current value to plot",
"led.plot|param|x": "TODO",
"led.plot|param|y": "TODO",
"led.plotBrightness": "Turn on the specified LED with specific brightness using x, y coordinates (x is horizontal, y is vertical). (0,0) is upper left.",
"led.plotBrightness|param|brightness": "the brightness from 0 (off) to 255 (bright), eg:255",
"led.plotBrightness|param|x": "the horizontal coordinate of the LED starting at 0",
"led.plotBrightness|param|y": "the vertical coordinate of the LED starting at 0",
"led.plot|param|x": "the horizontal coordinate of the LED starting at 0",
"led.plot|param|y": "the vertical coordinate of the LED starting at 0",
"led.point": "Get the on/off state of the specified LED using x, y coordinates. (0,0) is upper left.",
"led.point|param|x": "TODO",
"led.point|param|y": "TODO",
@ -349,24 +361,24 @@
"parseInt": "Convert A string to an integer.",
"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.",
"pins.analogPitch|param|frequency": "TODO",
"pins.analogPitch|param|ms": "TODO",
"pins.analogPitch|param|frequency": "frequency to modulate in Hz.",
"pins.analogPitch|param|ms": "duration of the pitch in milli seconds.",
"pins.analogReadPin": "Read the connector value as analog, that is, as a value comprised between 0 and 1023.",
"pins.analogReadPin|param|name": "pin to write to",
"pins.analogReadPin|param|name": "pin to write to, eg: AnalogPin.P0",
"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.",
"pins.analogSetPeriod|param|micros": "period in micro seconds. eg:20000",
"pins.analogSetPeriod|param|name": "analog pin to set period to",
"pins.analogSetPitchPin": "Sets the pin used when using `pins->analog pitch`.",
"pins.analogSetPitchPin|param|name": "TODO",
"pins.analogSetPeriod|param|name": "analog pin to set period to, eg: AnalogPin.P0",
"pins.analogSetPitchPin": "Sets the pin used when using `analog pitch` or music.",
"pins.analogSetPitchPin|param|name": "pin to modulate pitch from",
"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|name": "pin name to write to, eg: AnalogPin.P0",
"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.digitalReadPin|param|name": "pin to read from, eg: DigitalPin.P0",
"pins.digitalWritePin": "Set a pin or connector value to either 0 or 1.",
"pins.digitalWritePin|param|name": "pin to write to",
"pins.digitalWritePin|param|name": "pin to write to, eg: DigitalPin.P0",
"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.",
@ -379,23 +391,31 @@
"pins.map|param|toLow": "the lower bound of the value's target range",
"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.onPulsed|param|name": "digital pin to register to, eg: DigitalPin.P0",
"pins.onPulsed|param|pulse": "the value of the pulse, eg: PulseValue.High",
"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.pulseIn|param|name": "the pin which measures the pulse, eg: DigitalPin.P0",
"pins.pulseIn|param|value": "the value of the pulse, eg: PulseValue.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",
"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).",
"pins.servoWritePin|param|name": "pin to write to",
"pins.servoWritePin|param|name": "pin to write to, eg: AnalogPin.P0",
"pins.servoWritePin|param|value": "angle or rotation speed, eg:180,90,0",
"pins.setEvents": "Configures the events emitted by this pin. Events can be subscribed to\nusing ``control.onEvent()``.",
"pins.setEvents|param|name": "pin to set the event mode on, eg: DigitalPin.P0",
"pins.setEvents|param|type": "the type of events for this pin to emit, eg: PinEventType.Edge",
"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.setPull|param|name": "pin to set the pull mode on, eg: DigitalPin.P0",
"pins.setPull|param|pull": "one of the mbed pull configurations, eg: PinPullMode.PullUp",
"pins.sizeOf": "Get the size in bytes of specified number format.",
"pins.spiFormat": "Sets the SPI bits and mode",
"pins.spiFormat|param|bits": "the number of bits, eg: 8",
"pins.spiFormat|param|mode": "the mode, eg: 3",
"pins.spiFrequency": "Sets the SPI frequency",
"pins.spiFrequency|param|frequency": "the clock frequency, eg: 1000000",
"pins.spiPins": "Sets the MOSI, MISO, SCK pins used by the SPI instance",
"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.",

View File

@ -53,6 +53,8 @@
"DisplayMode.Greyscale|block": "greyscale",
"EventCreationMode.CreateAndFire": "MicroBitEvent is initialised, and its event handlers are immediately fired (not suitable for use in interrupts!).",
"EventCreationMode.CreateOnly": "MicroBitEvent is initialised, and no further processing takes place.",
"Gesture.EightG": "Raised when a 8G shock is detected",
"Gesture.EightG|block": "8g",
"Gesture.FreeFall": "Raised when the board is falling!",
"Gesture.FreeFall|block": "free fall",
"Gesture.LogoDown": "Raised when the logo is downward and the screen is vertical",
@ -147,6 +149,22 @@
"MelodyOptions.Forever|block": "forever",
"MelodyOptions.OnceInBackground|block": "once in background",
"MelodyOptions.Once|block": "once",
"MesDpadButtonInfo.ADown|block": "A down",
"MesDpadButtonInfo.AUp|block": "A up",
"MesDpadButtonInfo.BDown|block": "B down",
"MesDpadButtonInfo.BUp|block": "B up",
"MesDpadButtonInfo.CDown|block": "C down",
"MesDpadButtonInfo.CUp|block": "C up",
"MesDpadButtonInfo.DDown|block": "D down",
"MesDpadButtonInfo.DUp|block": "D up",
"MesDpadButtonInfo._1Down|block": "1 down",
"MesDpadButtonInfo._1Up|block": "1 up",
"MesDpadButtonInfo._2Down|block": "2 down",
"MesDpadButtonInfo._2Up|block": "2 up",
"MesDpadButtonInfo._3Down|block": "3 down",
"MesDpadButtonInfo._3Up|block": "3 up",
"MesDpadButtonInfo._4Down|block": "4 down",
"MesDpadButtonInfo._4Up|block": "4 up",
"Motor.AB|block": "A and B",
"MotorCommand.Break|block": "break",
"MotorCommand.Coast|block": "coast",
@ -213,6 +231,7 @@
"control.waitMicros|block": "wait (µs)%micros",
"control|block": "control",
"game.LedSprite.change|block": "%sprite|change %property|by %value",
"game.LedSprite.delete|block": "delete %this",
"game.LedSprite.get|block": "%sprite|%property",
"game.LedSprite.ifOnEdgeBounce|block": "%sprite|if on edge, bounce",
"game.LedSprite.isTouchingEdge|block": "%sprite|touching edge?",
@ -223,7 +242,10 @@
"game.addScore|block": "change score by|%points",
"game.createSprite|block": "create sprite at|x: %x|y: %y",
"game.gameOver|block": "game over",
"game.pause|block": "pause",
"game.resume|block": "resume",
"game.score|block": "score",
"game.setScore|block": "set score %points",
"game.startCountdown|block": "start countdown|(ms) %duration",
"game|block": "game",
"images.arrowImage|block": "arrow image %i=device_arrow",
@ -234,21 +256,25 @@
"images|block": "images",
"input.acceleration|block": "acceleration (mg)|%NAME",
"input.buttonIsPressed|block": "button|%NAME|is pressed",
"input.calibrateCompass|block": "calibrate compass",
"input.compassHeading|block": "compass heading (°)",
"input.lightLevel|block": "light level",
"input.magneticForce|block": "magnetic force (µT)|%NAME",
"input.onButtonPressed|block": "on button|%NAME|pressed",
"input.onGesture|block": "on |%NAME",
"input.onPinPressed|block": "on pin %NAME|pressed",
"input.onPinPressed|block": "on pin %name|pressed",
"input.onPinReleased|block": "on pin %NAME|released",
"input.pinIsPressed|block": "pin %NAME|is pressed",
"input.rotation|block": "rotation (°)|%NAME",
"input.runningTimeMicros|block": "running time (micros)",
"input.runningTime|block": "running time (ms)",
"input.setAccelerometerRange|block": "set accelerometer|range %range",
"input.temperature|block": "temperature (°C)",
"input|block": "input",
"led.brightness|block": "brightness",
"led.enable|block": "led enable %on",
"led.plotBarGraph|block": "plot bar graph of %value |up to %high",
"led.plotBrightness|block": "plot|x %x|y %y|brightness %brightness",
"led.plot|block": "plot|x %x|y %y",
"led.point|block": "point|x %x|y %y",
"led.setBrightness|block": "set brightness %value",
@ -290,6 +316,9 @@
"pins.servoWritePin|block": "servo write|pin %name|to %value",
"pins.setEvents|block": "set pin %pin|to emit %type|events",
"pins.setPull|block": "set pull|pin %pin|to %pull",
"pins.spiFormat|block": "spi format|bits %bits|mode %mode",
"pins.spiFrequency|block": "spi frequency %frequency",
"pins.spiPins|block": "spi set pins|MOSI %mosi|MISO %miso|SCK %sck",
"pins.spiWrite|block": "spi write %value",
"pins|block": "pins",
"serial.delimiters|block": "%del",