Afternoon
After running through the beginner's book, getting my Picos to flash lights, log temperatures and so on, I've moved on to trying to read the outputs from a BNO055 board, and am falling over at the first step.
I;ve tried on a Pico and Pico W, and can't import the relevalt library / drivers. The example code always looks for either bno055 or bno055_base, but despite installing them in Thonny, I get the message "ImportError: no module named 'bno055'"
I then tried fiddling around to see if there was another way of getting these modules onto the Pico, so tried both running each piece of .py code (bno055.py and bno055_base.py) on the pico, and copying each of them onto it.
Nothing worked.
It feels as though I am missing some very basic piece of information here around how I am supposed to install these libraries in order to allow my code to use them. I'm hoping that there's a very simple, obvious step that I am missing. Can anyone suggest what it is?
Re: BNO055 with Pi Pico
Which library are you using ? The 'usual' source of libs is by https://awesome-micropython.com/
Simple procedure is to create files "bno055.py" and "bno055_base.py in same dir on file system of pico.
Or create a folder "lib" and place the files there.
Explanation: python has a module search path which usually has own directory first, then the lib-folder in micropython. You can check this in REPL:
Simple procedure is to create files "bno055.py" and "bno055_base.py in same dir on file system of pico.
Or create a folder "lib" and place the files there.
Explanation: python has a module search path which usually has own directory first, then the lib-folder in micropython. You can check this in REPL:
Code: Select all
>>> import sys
>>> sys.path
['', '.frozen', '/lib']
>>>
Re: BNO055 with Pi Pico
Thanks for the prompt response.
I'd taken the libraries from Pimoroni, but will try them from your suggested location.
Both weer copied to the top level in the Pico, so I'll try putting them in a sub-folder as you suggest.
If it makes any difference I'm using a Pico W, which I know has some differences to the "non-W" Pico.
I'll try the changes and report back.
I'd taken the libraries from Pimoroni, but will try them from your suggested location.
Both weer copied to the top level in the Pico, so I'll try putting them in a sub-folder as you suggest.
If it makes any difference I'm using a Pico W, which I know has some differences to the "non-W" Pico.
I'll try the changes and report back.