integrating docs about "devices" namespace
This commit is contained in:
parent
5d8193301c
commit
67b5afd73a
@ -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
19
docs/reference/devices.md
Normal 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(() => {
|
||||
|
||||
});
|
||||
```
|
@ -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) {
|
||||
|
4
libs/microbit-devices/shims.d.ts
vendored
4
libs/microbit-devices/shims.d.ts
vendored
@ -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 {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user