Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8082

MicroPython • Re: How to import a library for raspberry pi pico w

$
0
0
I hope I can help. Like you when I started I found some of this not so immediately obvious.

Convention I was told was to create a 'lib' folder on the Pico that you can see from Thonny along with any .py files you create. Copy the library file code into a file and save it in the 'lib' folder. The import statement looks for the file in the 'lib' folder when the code compiles. SO in your case it look like you need the 'aht.py' file in the lib folder plus any others that you found necessary that were not default.

Please note that I learnt the hard way that filenames and the CASE of their naming seemed to also affect if they were found or not.

I hope that the I2C coding comes together, I spent a while getting library files for lcd displays and eeproms, the later was more complicated because the eeproms I had returned TWO addresses not one as I had expected and had experienced with the lcd display.

Statistics: Posted by Stratcat — Tue Feb 10, 2026 8:50 am



Viewing all articles
Browse latest Browse all 8082

Trending Articles