support for bluetooth accelerometer service. fix for #105

This commit is contained in:
Peli de Halleux 2016-06-14 13:47:18 -07:00
parent c1a6c1c66a
commit 918d2f1a3a
3 changed files with 27 additions and 8 deletions

View File

@ -8,7 +8,7 @@ namespace bluetooth {
* Starts the Bluetooth IO pin service * Starts the Bluetooth IO pin service
*/ */
//% help=bluetooth/start-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() { void startIOPinService() {
new MicroBitIOPinService(*uBit.ble, uBit.io); new MicroBitIOPinService(*uBit.ble, uBit.io);
} }
@ -17,7 +17,7 @@ namespace bluetooth {
* Starts the Bluetooth LED service * Starts the Bluetooth LED service
*/ */
//% help=bluetooth/start-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() { void startLEDService() {
new MicroBitLEDService(*uBit.ble, uBit.display); new MicroBitLEDService(*uBit.ble, uBit.display);
} }
@ -26,7 +26,7 @@ namespace bluetooth {
* Starts the temperature service * Starts the temperature service
*/ */
//% help=bluetooth/start-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() { void startTemperatureService() {
new MicroBitTemperatureService(*uBit.ble, uBit.thermometer); new MicroBitTemperatureService(*uBit.ble, uBit.thermometer);
} }
@ -35,8 +35,17 @@ namespace bluetooth {
* Starts the magnetometer service * Starts the magnetometer service
*/ */
//% help=bluetooth/start-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() { void startMagnetometerService() {
new MicroBitMagnetometerService(*uBit.ble, uBit.compass); 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);
}
} }

View File

@ -9,29 +9,36 @@ declare namespace bluetooth {
* Starts the Bluetooth IO pin service * Starts the Bluetooth IO pin service
*/ */
//% help=bluetooth/start-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; function startIOPinService(): void;
/** /**
* Starts the Bluetooth LED service * Starts the Bluetooth LED service
*/ */
//% help=bluetooth/start-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; function startLEDService(): void;
/** /**
* Starts the temperature service * Starts the temperature service
*/ */
//% help=bluetooth/start-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; function startTemperatureService(): void;
/** /**
* Starts the magnetometer service * Starts the magnetometer service
*/ */
//% help=bluetooth/start-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; 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. // Auto-generated. Do not edit. Really.

View File

@ -627,6 +627,9 @@ namespace pxsim.bluetooth {
export function startMagnetometerService(): void { export function startMagnetometerService(): void {
// TODO // TODO
} }
export function startAccelerometerService(): void {
// TODO
}
} }
namespace pxsim.images { namespace pxsim.images {