integrating docs about "devices" namespace

This commit is contained in:
Peli de Halleux 2016-06-21 11:17:34 -07:00
parent 5d8193301c
commit 67b5afd73a
5 changed files with 32 additions and 5 deletions

View File

@ -26,11 +26,11 @@ control.inBackground(() => {
## Advanced
```namespaces
bluetooth.onBluetoothConnected(() => {
});
devices.tellCameraTo(MesCameraEvent.TakePhoto);
bluetooth.onBluetoothConnected(() => {});
```
```package
microbit-devices
microbit-bluetooth
```

19
docs/reference/devices.md Normal file
View File

@ -0,0 +1,19 @@
# Devices
Control a phone with the BBC micro:bit via Bluetooth.
```cards
devices.tellCameraTo(MesCameraEvent.TakePhoto);
devices.tellRemoteControlTo(MesRemoteControlEvent.play);
devices.raiseAlertTo(MesAlertEvent.DisplayToast);
devices.onNotified(MesDeviceInfo.IncomingCall, () => {
});
devices.onGamepadButton(MesDpadButtonInfo.ADown, () => {
});
devices.signalStrength();
devices.onSignalStrengthChanged(() => {
});
```

View File

@ -2,6 +2,10 @@
#include "MESEvents.h"
using namespace pxt;
/**
* Support for additional Bluetooth services.
*/
//% color=#0082FB weight=20
namespace bluetooth {
/**

View File

@ -120,7 +120,9 @@ enum class MesDpadButtonInfo {
_4Up = MES_DPAD_BUTTON_4_UP,
};
/**
* Control a phone with the BBC micro:bit via Bluetooth.
*/
//% color=156 weight=80
namespace devices {
static void genEvent(int id, int event) {

View File

@ -1,7 +1,9 @@
// Auto-generated. Do not edit.
/**
* Control a phone with the BBC micro:bit via Bluetooth.
*/
//% color=156 weight=80
declare namespace devices {