Merge branch 'master' into pr/monacotoolbox
This commit is contained in:
		@@ -7,6 +7,10 @@ PXT ([Microsoft Programming Experience Toolkit](https://github.com/Microsoft/pxt
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[](https://travis-ci.org/Microsoft/pxt-microbit)
 | 
					[](https://travis-ci.org/Microsoft/pxt-microbit)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Issue tracking
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					All issue tracking for this repo happens at https://github.com/Microsoft/pxt, see you there!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Local server
 | 
					## Local server
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The local server allows to run the editor and the documentation from your computer.
 | 
					The local server allows to run the editor and the documentation from your computer.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,6 +19,7 @@ bluetooth.startMagnetometerService();
 | 
				
			|||||||
bluetooth.startTemperatureService();
 | 
					bluetooth.startTemperatureService();
 | 
				
			||||||
bluetooth.onBluetoothConnected(() => {});
 | 
					bluetooth.onBluetoothConnected(() => {});
 | 
				
			||||||
bluetooth.onBluetoothDisconnected(() => {});
 | 
					bluetooth.onBluetoothDisconnected(() => {});
 | 
				
			||||||
 | 
					bluetooth.setTransmitPower(7);
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## UART 
 | 
					## UART 
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										26
									
								
								docs/reference/bluetooth/set-transmit-power.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								docs/reference/bluetooth/set-transmit-power.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
				
			|||||||
 | 
					# Bluetooth Set Transmit Power
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### ~hint
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### ~
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Change the output power level of the transmitter to the given value.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```sig
 | 
				
			||||||
 | 
					bluetooth.setTransmitPower(7);
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Parameters
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* `power`: a [number](/reference/types/number) in the range ``0..7``, where ``0`` is the lowest power and ``7`` is the highest.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### See also
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[About Bluetooth](/reference/bluetooth/about-bluetooth), [@boardname@ Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [@boardname@ Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf),  [Bluetooth on @boardname@ resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```package
 | 
				
			||||||
 | 
					bluetooth
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
@@ -1,12 +1,15 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "bluetooth": "Support for additional Bluetooth services.",
 | 
					  "bluetooth": "Support for additional Bluetooth services.",
 | 
				
			||||||
  "bluetooth.advertiseUrl": "Advertise an Eddystone URL",
 | 
					  "bluetooth.advertiseUrl": "Advertise an Eddystone URL",
 | 
				
			||||||
  "bluetooth.advertiseUrl|param|power": "power level between 0 and 7, e.g.: 7",
 | 
					  "bluetooth.advertiseUrl|param|connectable": "true to keep bluetooth connectable for other services, false otherwise.",
 | 
				
			||||||
  "bluetooth.advertiseUrl|param|url": "the url to transmit. Must be no longer than the supported eddystone url length",
 | 
					  "bluetooth.advertiseUrl|param|power": "power level between 0 and 7, eg: 7",
 | 
				
			||||||
 | 
					  "bluetooth.advertiseUrl|param|url": "the url to transmit. Must be no longer than the supported eddystone url length, eg: \"https://pxt.io/\"",
 | 
				
			||||||
  "bluetooth.onBluetoothConnected": "Register code to run when the micro:bit is connected to over Bluetooth",
 | 
					  "bluetooth.onBluetoothConnected": "Register code to run when the micro:bit is connected to over Bluetooth",
 | 
				
			||||||
  "bluetooth.onBluetoothConnected|param|body": "Code to run when a Bluetooth connection is established",
 | 
					  "bluetooth.onBluetoothConnected|param|body": "Code to run when a Bluetooth connection is established",
 | 
				
			||||||
  "bluetooth.onBluetoothDisconnected": "Register code to run when a bluetooth connection to the micro:bit is lost",
 | 
					  "bluetooth.onBluetoothDisconnected": "Register code to run when a bluetooth connection to the micro:bit is lost",
 | 
				
			||||||
  "bluetooth.onBluetoothDisconnected|param|body": "Code to run when a Bluetooth connection is lost",
 | 
					  "bluetooth.onBluetoothDisconnected|param|body": "Code to run when a Bluetooth connection is lost",
 | 
				
			||||||
 | 
					  "bluetooth.setTransmitPower": "Sets the bluetooth transmit power between 0 (minimal) and 7 (maximum).",
 | 
				
			||||||
 | 
					  "bluetooth.setTransmitPower|param|power": "power level between 0 (minimal) and 7 (maximum), eg: 7.",
 | 
				
			||||||
  "bluetooth.startAccelerometerService": "Starts the Bluetooth accelerometer service",
 | 
					  "bluetooth.startAccelerometerService": "Starts the Bluetooth accelerometer service",
 | 
				
			||||||
  "bluetooth.startButtonService": "Starts the Bluetooth button service",
 | 
					  "bluetooth.startButtonService": "Starts the Bluetooth button service",
 | 
				
			||||||
  "bluetooth.startIOPinService": "Starts the Bluetooth IO pin service.",
 | 
					  "bluetooth.startIOPinService": "Starts the Bluetooth IO pin service.",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,8 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "bluetooth.advertiseUrl|block": "bluetooth advertise url %url|with power %power",
 | 
					  "bluetooth.advertiseUrl|block": "bluetooth advertise url %url|with power %power|connectable %connectable",
 | 
				
			||||||
  "bluetooth.onBluetoothConnected|block": "on bluetooth connected",
 | 
					  "bluetooth.onBluetoothConnected|block": "on bluetooth connected",
 | 
				
			||||||
  "bluetooth.onBluetoothDisconnected|block": "on bluetooth disconnected",
 | 
					  "bluetooth.onBluetoothDisconnected|block": "on bluetooth disconnected",
 | 
				
			||||||
 | 
					  "bluetooth.setTransmitPower|block": "bluetooth set transmit power %power",
 | 
				
			||||||
  "bluetooth.startAccelerometerService|block": "bluetooth accelerometer service",
 | 
					  "bluetooth.startAccelerometerService|block": "bluetooth accelerometer service",
 | 
				
			||||||
  "bluetooth.startButtonService|block": "bluetooth button service",
 | 
					  "bluetooth.startButtonService|block": "bluetooth button service",
 | 
				
			||||||
  "bluetooth.startIOPinService|block": "bluetooth io pin service",
 | 
					  "bluetooth.startIOPinService|block": "bluetooth io pin service",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -121,18 +121,30 @@ namespace bluetooth {
 | 
				
			|||||||
    } 
 | 
					    } 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const int8_t CALIBRATED_POWERS[] = {-49, -37, -33, -28, -25, -20, -15, -10};
 | 
					    const int8_t CALIBRATED_POWERS[] = {-49, -37, -33, -28, -25, -20, -15, -10};
 | 
				
			||||||
 | 
					 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
    * Advertise an Eddystone URL
 | 
					    * Advertise an Eddystone URL
 | 
				
			||||||
	* @param url the url to transmit. Must be no longer than the supported eddystone url length
 | 
						* @param url the url to transmit. Must be no longer than the supported eddystone url length, eg: "https://pxt.io/"
 | 
				
			||||||
	* @param power power level between 0 and 7, e.g.: 7
 | 
						* @param power power level between 0 and 7, eg: 7
 | 
				
			||||||
 | 
					    * @param connectable true to keep bluetooth connectable for other services, false otherwise.
 | 
				
			||||||
    */
 | 
					    */
 | 
				
			||||||
    //% blockId=eddystone_advertise_url block="bluetooth advertise url %url|with power %power"
 | 
					    //% blockId=eddystone_advertise_url block="bluetooth advertise url %url|with power %power|connectable %connectable"
 | 
				
			||||||
    //% parts=bluetooth weight=11 blockGap=8
 | 
					    //% parts=bluetooth weight=11 blockGap=8
 | 
				
			||||||
    //% help=bluetooth/advertise-url
 | 
					    //% help=bluetooth/advertise-url blockExternalInputs=1
 | 
				
			||||||
    void advertiseUrl(StringData* url, int power) {
 | 
					    void advertiseUrl(StringData* url, int power, bool connectable) {
 | 
				
			||||||
        int8_t level = CALIBRATED_POWERS[min(7, max(0, power))];
 | 
					        power = min(MICROBIT_BLE_POWER_LEVELS-1, max(0, power));
 | 
				
			||||||
        uBit.bleManager.advertiseEddystoneUrl(ManagedString(url), level);
 | 
					        int8_t level = CALIBRATED_POWERS[power];
 | 
				
			||||||
 | 
					        uBit.bleManager.advertiseEddystoneUrl(ManagedString(url), level, connectable);
 | 
				
			||||||
 | 
					        uBit.bleManager.setTransmitPower(power);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					    * Sets the bluetooth transmit power between 0 (minimal) and 7 (maximum).
 | 
				
			||||||
 | 
					    * @param power power level between 0 (minimal) and 7 (maximum), eg: 7.
 | 
				
			||||||
 | 
					    */
 | 
				
			||||||
 | 
					    //% parts=bluetooth weight=5 help=bluetooth/set-transmit-power advanced=true
 | 
				
			||||||
 | 
					    //% blockId=bluetooth_settransmitpower block="bluetooth set transmit power %power"
 | 
				
			||||||
 | 
					    void setTransmitPower(int power) {
 | 
				
			||||||
 | 
					        uBit.bleManager.setTransmitPower(min(MICROBIT_BLE_POWER_LEVELS-1, max(0, power)));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
@@ -140,7 +152,7 @@ namespace bluetooth {
 | 
				
			|||||||
    */
 | 
					    */
 | 
				
			||||||
    //% blockId=eddystone_stop_advertising block="bluetooth stop advertising"
 | 
					    //% blockId=eddystone_stop_advertising block="bluetooth stop advertising"
 | 
				
			||||||
    //% parts=bluetooth weight=10
 | 
					    //% parts=bluetooth weight=10
 | 
				
			||||||
    //% help=bluetooth/stop-advertising
 | 
					    //% help=bluetooth/stop-advertising advanced=true
 | 
				
			||||||
    void stopAdvertising() {
 | 
					    void stopAdvertising() {
 | 
				
			||||||
        uBit.bleManager.stopAdvertising();
 | 
					        uBit.bleManager.stopAdvertising();
 | 
				
			||||||
    } 
 | 
					    } 
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,7 +24,6 @@
 | 
				
			|||||||
            "microbit-dal": {
 | 
					            "microbit-dal": {
 | 
				
			||||||
                "bluetooth": {
 | 
					                "bluetooth": {
 | 
				
			||||||
                    "private_addressing": 0,
 | 
					                    "private_addressing": 0,
 | 
				
			||||||
                    "whitelist": 1,
 | 
					 | 
				
			||||||
                    "advertising_timeout": 0,
 | 
					                    "advertising_timeout": 0,
 | 
				
			||||||
                    "tx_power": 6,
 | 
					                    "tx_power": 6,
 | 
				
			||||||
                    "dfu_service": 1,
 | 
					                    "dfu_service": 1,
 | 
				
			||||||
@@ -32,8 +31,9 @@
 | 
				
			|||||||
                    "device_info_service": 1,
 | 
					                    "device_info_service": 1,
 | 
				
			||||||
                    "eddystone_url": 1,
 | 
					                    "eddystone_url": 1,
 | 
				
			||||||
                    "eddystone_uid": 0,
 | 
					                    "eddystone_uid": 0,
 | 
				
			||||||
                    "pairing_mode": 1,
 | 
					 | 
				
			||||||
                    "open": 0,
 | 
					                    "open": 0,
 | 
				
			||||||
 | 
					                    "pairing_mode": 1,
 | 
				
			||||||
 | 
					                    "whitelist": 1,
 | 
				
			||||||
                    "security_level": "SECURITY_MODE_ENCRYPTION_NO_MITM"
 | 
					                    "security_level": "SECURITY_MODE_ENCRYPTION_NO_MITM"
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
@@ -47,13 +47,14 @@
 | 
				
			|||||||
                        "bluetooth": {
 | 
					                        "bluetooth": {
 | 
				
			||||||
                            "open": 1,
 | 
					                            "open": 1,
 | 
				
			||||||
                            "pairing_mode": 0,                            
 | 
					                            "pairing_mode": 0,                            
 | 
				
			||||||
                            "whitelist": 0
 | 
					                            "whitelist": 0,
 | 
				
			||||||
 | 
					                            "security_level": null
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                "description": "JustWorks pairing (default): Button press to pair via Bluetooth.",
 | 
					                "description": "JustWorks pairing (default): Button press to pair.",
 | 
				
			||||||
                "config": {
 | 
					                "config": {
 | 
				
			||||||
                    "microbit-dal": {
 | 
					                    "microbit-dal": {
 | 
				
			||||||
                        "bluetooth": {
 | 
					                        "bluetooth": {
 | 
				
			||||||
@@ -66,7 +67,7 @@
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                "description": "Passkey pairing: Button press and 6 digit key to pair via Bluetooth.",
 | 
					                "description": "Passkey pairing: Button press and 6 digit key to pair.",
 | 
				
			||||||
                "config": {
 | 
					                "config": {
 | 
				
			||||||
                    "microbit-dal": {
 | 
					                    "microbit-dal": {
 | 
				
			||||||
                        "bluetooth": {
 | 
					                        "bluetooth": {
 | 
				
			||||||
@@ -77,18 +78,6 @@
 | 
				
			|||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                "description": "Disable Event, Device Info and Device Flashing services.",
 | 
					 | 
				
			||||||
                "config": {
 | 
					 | 
				
			||||||
                    "microbit-dal": {
 | 
					 | 
				
			||||||
                        "bluetooth": {
 | 
					 | 
				
			||||||
                            "dfu_service": 0,
 | 
					 | 
				
			||||||
                            "event_service": 0,
 | 
					 | 
				
			||||||
                            "device_info_service": 0
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										21
									
								
								libs/bluetooth/shims.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										21
									
								
								libs/bluetooth/shims.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -83,20 +83,29 @@ declare namespace bluetooth {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Advertise an Eddystone URL
 | 
					     * Advertise an Eddystone URL
 | 
				
			||||||
     * @param url the url to transmit. Must be no longer than the supported eddystone url length
 | 
					     * @param url the url to transmit. Must be no longer than the supported eddystone url length, eg: "https://pxt.io/"
 | 
				
			||||||
     * @param power power level between 0 and 7, e.g.: 7
 | 
					     * @param power power level between 0 and 7, eg: 7
 | 
				
			||||||
 | 
					     * @param connectable true to keep bluetooth connectable for other services, false otherwise.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    //% blockId=eddystone_advertise_url block="bluetooth advertise url %url|with power %power"
 | 
					    //% blockId=eddystone_advertise_url block="bluetooth advertise url %url|with power %power|connectable %connectable"
 | 
				
			||||||
    //% parts=bluetooth weight=11 blockGap=8
 | 
					    //% parts=bluetooth weight=11 blockGap=8
 | 
				
			||||||
    //% help=bluetooth/advertise-url shim=bluetooth::advertiseUrl
 | 
					    //% help=bluetooth/advertise-url blockExternalInputs=1 shim=bluetooth::advertiseUrl
 | 
				
			||||||
    function advertiseUrl(url: string, power: number): void;
 | 
					    function advertiseUrl(url: string, power: number, connectable: boolean): void;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Sets the bluetooth transmit power between 0 (minimal) and 7 (maximum).
 | 
				
			||||||
 | 
					     * @param power power level between 0 (minimal) and 7 (maximum), eg: 7.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    //% parts=bluetooth weight=5 help=bluetooth/set-transmit-power advanced=true
 | 
				
			||||||
 | 
					    //% blockId=bluetooth_settransmitpower block="bluetooth set transmit power %power" shim=bluetooth::setTransmitPower
 | 
				
			||||||
 | 
					    function setTransmitPower(power: number): void;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Stops advertising Eddystone end points
 | 
					     * Stops advertising Eddystone end points
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    //% blockId=eddystone_stop_advertising block="bluetooth stop advertising"
 | 
					    //% blockId=eddystone_stop_advertising block="bluetooth stop advertising"
 | 
				
			||||||
    //% parts=bluetooth weight=10
 | 
					    //% parts=bluetooth weight=10
 | 
				
			||||||
    //% help=bluetooth/stop-advertising shim=bluetooth::stopAdvertising
 | 
					    //% help=bluetooth/stop-advertising advanced=true shim=bluetooth::stopAdvertising
 | 
				
			||||||
    function stopAdvertising(): void;
 | 
					    function stopAdvertising(): void;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -589,7 +589,7 @@ namespace game {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        /**
 | 
					        /**
 | 
				
			||||||
         * Turns on the sprite (on by default)
 | 
					         * Turns on the sprite (on by default)
 | 
				
			||||||
         * @param this TODO
 | 
					         * @param this the sprite
 | 
				
			||||||
         */
 | 
					         */
 | 
				
			||||||
        public on(): void {
 | 
					        public on(): void {
 | 
				
			||||||
            this.setBrightness(255);
 | 
					            this.setBrightness(255);
 | 
				
			||||||
@@ -597,7 +597,7 @@ namespace game {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        /**
 | 
					        /**
 | 
				
			||||||
         * Turns off the sprite (on by default)
 | 
					         * Turns off the sprite (on by default)
 | 
				
			||||||
         * @param this TODO
 | 
					         * @param this the sprite
 | 
				
			||||||
         */
 | 
					         */
 | 
				
			||||||
        public off(): void {
 | 
					        public off(): void {
 | 
				
			||||||
            this.setBrightness(0);
 | 
					            this.setBrightness(0);
 | 
				
			||||||
@@ -605,8 +605,8 @@ namespace game {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        /**
 | 
					        /**
 | 
				
			||||||
         * Set the ``brightness`` of a sprite
 | 
					         * Set the ``brightness`` of a sprite
 | 
				
			||||||
         * @param this TODO
 | 
					         * @param this the sprite
 | 
				
			||||||
         * @param brightness TODO
 | 
					         * @param brightness the brightness from 0 (off) to 255 (on), eg: 255.
 | 
				
			||||||
         */
 | 
					         */
 | 
				
			||||||
        //% parts="ledmatrix"
 | 
					        //% parts="ledmatrix"
 | 
				
			||||||
        public setBrightness(brightness: number): void {
 | 
					        public setBrightness(brightness: number): void {
 | 
				
			||||||
@@ -616,8 +616,9 @@ namespace game {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        /**
 | 
					        /**
 | 
				
			||||||
         * Reports the ``brightness` of a sprite on the LED screen
 | 
					         * Reports the ``brightness` of a sprite on the LED screen
 | 
				
			||||||
         * @param this TODO
 | 
					         * @param this the sprite
 | 
				
			||||||
         */
 | 
					         */
 | 
				
			||||||
 | 
					        //% parts="ledmatrix"
 | 
				
			||||||
        public brightness(): number {
 | 
					        public brightness(): number {
 | 
				
			||||||
            let r: number;
 | 
					            let r: number;
 | 
				
			||||||
            return this._brightness;
 | 
					            return this._brightness;
 | 
				
			||||||
@@ -625,8 +626,8 @@ namespace game {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        /**
 | 
					        /**
 | 
				
			||||||
         * Changes the ``y`` position by the given amount
 | 
					         * Changes the ``y`` position by the given amount
 | 
				
			||||||
         * @param this TODO
 | 
					         * @param this the sprite
 | 
				
			||||||
         * @param value TODO
 | 
					         * @param value the value to change brightness
 | 
				
			||||||
         */
 | 
					         */
 | 
				
			||||||
        public changeBrightnessBy(value: number): void {
 | 
					        public changeBrightnessBy(value: number): void {
 | 
				
			||||||
            this.setBrightness(this._brightness + value);
 | 
					            this.setBrightness(this._brightness + value);
 | 
				
			||||||
@@ -643,10 +644,11 @@ namespace game {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        /**
 | 
					        /**
 | 
				
			||||||
         * Deletes the sprite from the game engine. All further operation of the sprite will not have any effect.
 | 
					         * Deletes the sprite from the game engine. All further operation of the sprite will not have any effect.
 | 
				
			||||||
         * @param sprite TODO
 | 
					         * @param this sprite to delete
 | 
				
			||||||
         */
 | 
					         */
 | 
				
			||||||
        public delete(sprite: LedSprite): void {
 | 
					        //% blockId="game_delete_sprite" block="delete %this"        
 | 
				
			||||||
            sprites.removeElement(sprite);
 | 
					        public delete(): void {
 | 
				
			||||||
 | 
					            sprites.removeElement(this);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /**
 | 
					        /**
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -117,7 +117,6 @@ namespace pxt {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    void RefObject::destroy() {
 | 
					    void RefObject::destroy() {
 | 
				
			||||||
      ((RefObjectMethod)getVTable()->methods[0])(this);
 | 
					      ((RefObjectMethod)getVTable()->methods[0])(this);
 | 
				
			||||||
      delete this;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void RefObject::print() {
 | 
					    void RefObject::print() {
 | 
				
			||||||
@@ -132,6 +131,7 @@ namespace pxt {
 | 
				
			|||||||
          if (refmask[i]) decr(r->fields[i]);
 | 
					          if (refmask[i]) decr(r->fields[i]);
 | 
				
			||||||
          r->fields[i] = 0;
 | 
					          r->fields[i] = 0;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        delete r;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void RefRecord_print(RefRecord *r)
 | 
					    void RefRecord_print(RefRecord *r)
 | 
				
			||||||
@@ -242,6 +242,7 @@ namespace pxt {
 | 
				
			|||||||
          this->data[i] = 0;
 | 
					          this->data[i] = 0;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      this->data.resize(0);
 | 
					      this->data.resize(0);
 | 
				
			||||||
 | 
					      delete this;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void RefCollection::print()
 | 
					    void RefCollection::print()
 | 
				
			||||||
@@ -258,6 +259,7 @@ namespace pxt {
 | 
				
			|||||||
        decr(fields[i]);
 | 
					        decr(fields[i]);
 | 
				
			||||||
        fields[i] = 0;
 | 
					        fields[i] = 0;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					      delete this;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void RefAction::print()
 | 
					    void RefAction::print()
 | 
				
			||||||
@@ -272,6 +274,7 @@ namespace pxt {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    void RefLocal::destroy()
 | 
					    void RefLocal::destroy()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					      delete this;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    PXT_VTABLE_CTOR(RefLocal) {
 | 
					    PXT_VTABLE_CTOR(RefLocal) {
 | 
				
			||||||
@@ -290,6 +293,7 @@ namespace pxt {
 | 
				
			|||||||
    void RefRefLocal::destroy()
 | 
					    void RefRefLocal::destroy()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      decr(v);
 | 
					      decr(v);
 | 
				
			||||||
 | 
					      delete this;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    PXT_VTABLE_BEGIN(RefMap, 0, RefMapMarker)
 | 
					    PXT_VTABLE_BEGIN(RefMap, 0, RefMapMarker)
 | 
				
			||||||
@@ -304,6 +308,7 @@ namespace pxt {
 | 
				
			|||||||
        data[i].val = 0;
 | 
					        data[i].val = 0;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      data.resize(0);
 | 
					      data.resize(0);
 | 
				
			||||||
 | 
					      delete this;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    int RefMap::findIdx(uint32_t key) {
 | 
					    int RefMap::findIdx(uint32_t key) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "pxt-microbit",
 | 
					  "name": "pxt-microbit",
 | 
				
			||||||
  "version": "0.6.30",
 | 
					  "version": "0.6.31",
 | 
				
			||||||
  "description": "micro:bit target for PXT",
 | 
					  "description": "micro:bit target for PXT",
 | 
				
			||||||
  "keywords": [
 | 
					  "keywords": [
 | 
				
			||||||
    "JavaScript",
 | 
					    "JavaScript",
 | 
				
			||||||
@@ -34,6 +34,6 @@
 | 
				
			|||||||
    "semantic-ui-less": "^2.2.4"
 | 
					    "semantic-ui-less": "^2.2.4"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "pxt-core": "0.5.90"
 | 
					    "pxt-core": "0.5.91"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -177,7 +177,8 @@ namespace pxsim.bluetooth {
 | 
				
			|||||||
    export function onBluetoothDisconnected(a: RefAction) {
 | 
					    export function onBluetoothDisconnected(a: RefAction) {
 | 
				
			||||||
        // TODO
 | 
					        // TODO
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    export function advertiseUrl(url: string, power: number) { }
 | 
					    export function advertiseUrl(url: string, power: number, connectable: boolean) { }
 | 
				
			||||||
    export function stopAdvertising() { }
 | 
					    export function stopAdvertising() { }
 | 
				
			||||||
 | 
					    export function setTransmitPower(power: number) {}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -61,6 +61,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
.blocklyFlyoutBackground {
 | 
					.blocklyFlyoutBackground {
 | 
				
			||||||
    fill: #525A67 !important;
 | 
					    fill: #525A67 !important;
 | 
				
			||||||
 | 
					    fill-opacity: 0.5 !important;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Remove shadow around blockly blocks */
 | 
					/* Remove shadow around blockly blocks */
 | 
				
			||||||
@@ -115,6 +116,11 @@
 | 
				
			|||||||
    .organization {
 | 
					    .organization {
 | 
				
			||||||
        top: auto;
 | 
					        top: auto;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    /* Blockly Toolbox buttons */
 | 
				
			||||||
 | 
					    #blocklyToolboxButtons {
 | 
				
			||||||
 | 
					        margin-right: 0.5rem;
 | 
				
			||||||
 | 
					        margin-left: 0.5rem;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Small Monitor */
 | 
					/* Small Monitor */
 | 
				
			||||||
@@ -122,6 +128,11 @@
 | 
				
			|||||||
    .organization {
 | 
					    .organization {
 | 
				
			||||||
        top: auto;
 | 
					        top: auto;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    /* Blockly Toolbox buttons */
 | 
				
			||||||
 | 
					    #blocklyToolboxButtons {
 | 
				
			||||||
 | 
					        margin-right: 1rem;
 | 
				
			||||||
 | 
					        margin-left: 1rem;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Large Monitor */
 | 
					/* Large Monitor */
 | 
				
			||||||
@@ -130,4 +141,9 @@
 | 
				
			|||||||
        width: 230px;
 | 
					        width: 230px;
 | 
				
			||||||
        padding-left: 1rem;
 | 
					        padding-left: 1rem;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    /* Blockly Toolbox buttons */
 | 
				
			||||||
 | 
					    #blocklyToolboxButtons {
 | 
				
			||||||
 | 
					        margin-right: 2rem;
 | 
				
			||||||
 | 
					        margin-left: 2rem;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user