support for bluetooth accelerometer service. fix for #105
This commit is contained in:
parent
c1a6c1c66a
commit
918d2f1a3a
@ -8,7 +8,7 @@ namespace bluetooth {
|
||||
* Starts the Bluetooth IO pin service
|
||||
*/
|
||||
//% help=bluetooth/start-io-pin-service
|
||||
//% blockId=bluetooth_start_io_pin_service block="bluetooth io pin service"
|
||||
//% blockId=bluetooth_start_io_pin_service block="bluetooth io pin service" blockGap=8
|
||||
void startIOPinService() {
|
||||
new MicroBitIOPinService(*uBit.ble, uBit.io);
|
||||
}
|
||||
@ -17,7 +17,7 @@ namespace bluetooth {
|
||||
* Starts the Bluetooth LED service
|
||||
*/
|
||||
//% help=bluetooth/start-led-service
|
||||
//% blockId=bluetooth_start_led_service block="bluetooth led service"
|
||||
//% blockId=bluetooth_start_led_service block="bluetooth led service" blockGap=8
|
||||
void startLEDService() {
|
||||
new MicroBitLEDService(*uBit.ble, uBit.display);
|
||||
}
|
||||
@ -26,7 +26,7 @@ namespace bluetooth {
|
||||
* Starts the temperature service
|
||||
*/
|
||||
//% help=bluetooth/start-temperature-service
|
||||
//% blockId=bluetooth_start_temperature_service block="bluetooth temperature service"
|
||||
//% blockId=bluetooth_start_temperature_service block="bluetooth temperature service" blockGap=8
|
||||
void startTemperatureService() {
|
||||
new MicroBitTemperatureService(*uBit.ble, uBit.thermometer);
|
||||
}
|
||||
@ -35,8 +35,17 @@ namespace bluetooth {
|
||||
* Starts the magnetometer service
|
||||
*/
|
||||
//% help=bluetooth/start-magnetometer-service
|
||||
//% blockId=bluetooth_start_magnetometer_service block="bluetooth magnetometer service"
|
||||
//% blockId=bluetooth_start_magnetometer_service block="bluetooth magnetometer service" blockGap=8
|
||||
void startMagnetometerService() {
|
||||
new MicroBitMagnetometerService(*uBit.ble, uBit.compass);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the accelerometer service
|
||||
*/
|
||||
//% help=bluetooth/start-accelerometer-service
|
||||
//% blockId=bluetooth_start_accelerometer_service block="bluetooth accelerometer service" blockGap=8
|
||||
void startAccelerometerService() {
|
||||
new MicroBitAccelerometerService(*uBit.ble, uBit.accelerometer);
|
||||
}
|
||||
}
|
||||
|
15
libs/microbit-bluetooth/shims.d.ts
vendored
15
libs/microbit-bluetooth/shims.d.ts
vendored
@ -9,29 +9,36 @@ declare namespace bluetooth {
|
||||
* Starts the Bluetooth IO pin service
|
||||
*/
|
||||
//% help=bluetooth/start-io-pin-service
|
||||
//% blockId=bluetooth_start_io_pin_service block="bluetooth io pin service" shim=bluetooth::startIOPinService
|
||||
//% blockId=bluetooth_start_io_pin_service block="bluetooth io pin service" blockGap=8 shim=bluetooth::startIOPinService
|
||||
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
|
||||
//% blockId=bluetooth_start_led_service block="bluetooth led service" blockGap=8 shim=bluetooth::startLEDService
|
||||
function startLEDService(): void;
|
||||
|
||||
/**
|
||||
* Starts the temperature service
|
||||
*/
|
||||
//% help=bluetooth/start-temperature-service
|
||||
//% blockId=bluetooth_start_temperature_service block="bluetooth temperature service" shim=bluetooth::startTemperatureService
|
||||
//% blockId=bluetooth_start_temperature_service block="bluetooth temperature service" blockGap=8 shim=bluetooth::startTemperatureService
|
||||
function startTemperatureService(): void;
|
||||
|
||||
/**
|
||||
* Starts the magnetometer service
|
||||
*/
|
||||
//% help=bluetooth/start-magnetometer-service
|
||||
//% blockId=bluetooth_start_magnetometer_service block="bluetooth magnetometer service" shim=bluetooth::startMagnetometerService
|
||||
//% blockId=bluetooth_start_magnetometer_service block="bluetooth magnetometer service" blockGap=8 shim=bluetooth::startMagnetometerService
|
||||
function startMagnetometerService(): void;
|
||||
|
||||
/**
|
||||
* Starts the accelerometer service
|
||||
*/
|
||||
//% help=bluetooth/start-accelerometer-service
|
||||
//% blockId=bluetooth_start_accelerometer_service block="bluetooth accelerometer service" blockGap=8 shim=bluetooth::startAccelerometerService
|
||||
function startAccelerometerService(): void;
|
||||
}
|
||||
|
||||
// Auto-generated. Do not edit. Really.
|
||||
|
@ -627,6 +627,9 @@ namespace pxsim.bluetooth {
|
||||
export function startMagnetometerService(): void {
|
||||
// TODO
|
||||
}
|
||||
export function startAccelerometerService(): void {
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
|
||||
namespace pxsim.images {
|
||||
|
Loading…
Reference in New Issue
Block a user