通过蓝牙使用 bbc:microbit 时如何访问光传感器值?
How can I access the light sensor value when using bbc:microbit over bluetooth?
我正在玩弄 bbc:microbit,使用 bluetooth web api 访问 microbit 服务数据(按钮事件、led、磁力计等)。
似乎无法从 javascript API 访问光传感器信息。
从 microbit 文档中,可以从 led 服务访问光感测,但看起来 lib 缺少它们。
micro:bit 蓝牙配置文件定义于:
https://lancaster-university.github.io/microbit-docs/resources/bluetooth/bluetooth_profile.html
默认情况下,它不会通过蓝牙公开光传感器信息。我最初想到的快速解决方法是您可以通过蓝牙 UART 服务发送值。我在 https://makecode.microbit.org/#editor 使用编辑器为 micro:bit 创建了一个 hex 文件,它似乎有效:
我正在玩弄 bbc:microbit,使用 bluetooth web api 访问 microbit 服务数据(按钮事件、led、磁力计等)。
似乎无法从 javascript API 访问光传感器信息。 从 microbit 文档中,可以从 led 服务访问光感测,但看起来 lib 缺少它们。
micro:bit 蓝牙配置文件定义于:
https://lancaster-university.github.io/microbit-docs/resources/bluetooth/bluetooth_profile.html
默认情况下,它不会通过蓝牙公开光传感器信息。我最初想到的快速解决方法是您可以通过蓝牙 UART 服务发送值。我在 https://makecode.microbit.org/#editor 使用编辑器为 micro:bit 创建了一个 hex 文件,它似乎有效: