diff --git a/libs/microbit-bluetooth/bluetooth.cpp b/libs/microbit-bluetooth/bluetooth.cpp index 2f1f759a..7e6f63d9 100644 --- a/libs/microbit-bluetooth/bluetooth.cpp +++ b/libs/microbit-bluetooth/bluetooth.cpp @@ -48,4 +48,13 @@ namespace bluetooth { void startAccelerometerService() { new MicroBitAccelerometerService(*uBit.ble, uBit.accelerometer); } + + /** + * Starts the button service + */ + //% help=bluetooth/start-button-service + //% blockId=bluetooth_start_button_service block="bluetooth button service" blockGap=8 + void startButtonService() { + new MicroBitButtonService(*uBit.ble); + } } diff --git a/libs/microbit-bluetooth/shims.d.ts b/libs/microbit-bluetooth/shims.d.ts index 4979fbed..85393c00 100644 --- a/libs/microbit-bluetooth/shims.d.ts +++ b/libs/microbit-bluetooth/shims.d.ts @@ -39,6 +39,13 @@ declare namespace bluetooth { //% help=bluetooth/start-accelerometer-service //% blockId=bluetooth_start_accelerometer_service block="bluetooth accelerometer service" blockGap=8 shim=bluetooth::startAccelerometerService function startAccelerometerService(): void; + + /** + * Starts the button service + */ + //% help=bluetooth/start-button-service + //% blockId=bluetooth_start_button_service block="bluetooth button service" blockGap=8 shim=bluetooth::startButtonService + function startButtonService(): void; } // Auto-generated. Do not edit. Really. diff --git a/sim/libmbit.ts b/sim/libmbit.ts index 0e5ec72f..1e9a7a92 100644 --- a/sim/libmbit.ts +++ b/sim/libmbit.ts @@ -630,6 +630,9 @@ namespace pxsim.bluetooth { export function startAccelerometerService(): void { // TODO } + export function startButtonService(): void { + // TODO + } } namespace pxsim.images {