Micropython ESP32:蓝牙与 ubluetooth
Micropython ESP32: bluetooth vs ubluetooth
为什么 ubluetooth 没有出现在 MicroPython 文档中?图书馆从哪里来?
我能够在 ESP32 devkit 上的 micropython shell 中导入这两个库:
ubluetooth -- 来自 mPython,docs here
蓝牙——来自 MicroPython,docs here
DevKit 上 运行 MicroPython 的版本是什么?这将取决于构建的来源以及哪些库被冻结到构建中。在 MicroPython 的 v1.18 中,支持在 bluetooth
库中。
来自https://docs.micropython.org/en/latest/library/index.html
MicroPython provides built-in modules that mirror the functionality of the Python standard library (e.g. os, time), as well as MicroPython-specific modules (e.g. bluetooth, machine).
Most standard library modules implement a subset of the functionality of the equivalent Python module, and in a few cases provide some MicroPython-specific extensions (e.g. array, os)
...还有,重要的是:
In most cases, the above modules are actually named umodule rather than module, but MicroPython will alias any module prefixed with a u to the non-u version. However a file (or frozen module) named module.py will take precedence over this alias.
这应该可以解释您所看到的行为。
为什么 ubluetooth 没有出现在 MicroPython 文档中?图书馆从哪里来?
我能够在 ESP32 devkit 上的 micropython shell 中导入这两个库:
ubluetooth -- 来自 mPython,docs here
蓝牙——来自 MicroPython,docs here
DevKit 上 运行 MicroPython 的版本是什么?这将取决于构建的来源以及哪些库被冻结到构建中。在 MicroPython 的 v1.18 中,支持在 bluetooth
库中。
来自https://docs.micropython.org/en/latest/library/index.html
MicroPython provides built-in modules that mirror the functionality of the Python standard library (e.g. os, time), as well as MicroPython-specific modules (e.g. bluetooth, machine).
Most standard library modules implement a subset of the functionality of the equivalent Python module, and in a few cases provide some MicroPython-specific extensions (e.g. array, os)
...还有,重要的是:
In most cases, the above modules are actually named umodule rather than module, but MicroPython will alias any module prefixed with a u to the non-u version. However a file (or frozen module) named module.py will take precedence over this alias.
这应该可以解释您所看到的行为。