正确安装micropython库BNO055 / IMU

问题描述

尝试在Micropython下将BNO055 IMU 9DOF传感器与我的ESP32一起使用。

为此,您需要安装/使用一个库。但是,当我按照adafruit / circuitpython的说明进行操作时,则无法识别。

这是我的设置:

  1. ESP32 + MU编辑器(alpha版本,可与ESP32一起使用)
  2. BNO已正确连接(并经过测试)到ESP32的I2C端口
  3. 已安装Windows 10计算机+ python 3.7.4(和python 2.7)。
  4. 根据this指南安装我使用过pip3 install adafruit-circuitpython-bno055的库
  5. 基本眨眼草图和python REPL控制台似乎正常工作

我尝试过:

  • 搜索
  • 确保MU环境在python 3中运行
  • 以管理模式运行MU
  • 更多东西...

代码:简单的眨眼素描+在下面导入bno055。如何调试此错误使我感到困惑,并且文档稀疏(按我的喜好),任何指导都非常感谢。

# Write your code here :-)
import machine
import time
import adafruit_bno055

p2_led = Pin(2,Pin.OUT)

while True:
    p2_led.on()
    time.sleep(1)
    p2_led.off()
    time.sleep(1)

错误

>>> 
raw REPL; CTRL-B to exit
>OK

Traceback (most recent call last):
  File "<stdin>",line 5,in <module>
ImportError: no module named 'adafruit_bno055'
>
MicroPython v1.13 on 2020-09-02; ESP32 module with ESP32
Type "help()" for more @R_183_4045@ion.
>>> 

编辑:即使识别出模块,它似乎也不起作用。再次,几乎没有调试信息要继续(即,什么文件引发错误以及它位于何处...),否则将很乐意提供。我对此感到非常困惑,欢迎提出任何建议。在MU管理控制台下方,显示代码错误

enter image description here

代码

# Write your code here :-)
import machine
import time
import Adafruit-BNO055

错误

raw REPL; CTRL-B to exit
>OKTraceback (most recent call last):
  File "<stdin>",line 5
SyntaxError: invalid Syntax
>
MicroPython v1.13 on 2020-09-02; ESP32 module with ESP32
Type "help()" for more @R_183_4045@ion.

解决方法

答案很简单。将库放在板子上...(Source from a forum post

enter image description here

然后只需将库转移到董事会:

enter image description here