Add Bluetooth LED service. fix for #111

This commit is contained in:
Peli de Halleux 2016-06-14 13:17:20 -07:00
parent 43c7692a8f
commit bb20c1780b
2 changed files with 22 additions and 6 deletions

View File

@ -2,14 +2,23 @@
#include "MESEvents.h" #include "MESEvents.h"
using namespace pxt; using namespace pxt;
//% color=#0082FB weight=2 //% color=#0082FB weight=20
namespace bluetooth { namespace bluetooth {
/** /**
* Starts the Bluetooth IO pin service * Starts the Bluetooth IO pin service
*/ */
//% help=bluetooth/io-pin-service //% help=bluetooth/start-io-pin-service
//% blockId=bluetooth-io-pin-service block="bluetooth io pin service" //% blockId=bluetooth_start_io_pin_service block="bluetooth io pin service"
void startIOPinService() { void startIOPinService() {
new MicroBitIOPinService(*uBit.ble, uBit.io); new MicroBitIOPinService(*uBit.ble, uBit.io);
} }
/**
* Starts the Bluetooth LED service
*/
//% help=bluetooth/start-led-service
//% blockId=bluetooth_start_led_service block="bluetooth led service"
void startLEDService() {
new MicroBitLEDService(*uBit.ble, uBit.display);
}
} }

View File

@ -2,15 +2,22 @@
//% color=#0082FB weight=2 //% color=#0082FB weight=20
declare namespace bluetooth { declare namespace bluetooth {
/** /**
* Starts the Bluetooth IO pin service * Starts the Bluetooth IO pin service
*/ */
//% help=bluetooth/io-pin-service //% help=bluetooth/start-io-pin-service
//% blockId=bluetooth-io-pin-service block="bluetooth io pin service" shim=bluetooth::startIOPinService //% blockId=bluetooth_start_io_pin_service block="bluetooth io pin service" shim=bluetooth::startIOPinService
function startIOPinService(): void; function startIOPinService(): void;
/**
* Starts the Bluetooth LED service
*/
//% help=bluetooth/start-led-service
//% blockId=bluetooth_start_led_service block="bluetooth led service" shim=bluetooth::startLEDService
function startLEDService(): void;
} }
// Auto-generated. Do not edit. Really. // Auto-generated. Do not edit. Really.