integrating docs about "devices" namespace
This commit is contained in:
Родитель
5d8193301c
Коммит
67b5afd73a
|
@ -26,11 +26,11 @@ control.inBackground(() => {
|
|||
## Advanced
|
||||
|
||||
```namespaces
|
||||
bluetooth.onBluetoothConnected(() => {
|
||||
|
||||
});
|
||||
devices.tellCameraTo(MesCameraEvent.TakePhoto);
|
||||
bluetooth.onBluetoothConnected(() => {});
|
||||
```
|
||||
|
||||
```package
|
||||
microbit-devices
|
||||
microbit-bluetooth
|
||||
```
|
|
@ -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(() => {
|
||||
|
||||
});
|
||||
```
|
|
@ -2,6 +2,10 @@
|
|||
#include "MESEvents.h"
|
||||
|
||||
using namespace pxt;
|
||||
|
||||
/**
|
||||
* Support for additional Bluetooth services.
|
||||
*/
|
||||
//% color=#0082FB weight=20
|
||||
namespace bluetooth {
|
||||
/**
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче