Importing Libraries | Raspberry Pi Pico Workshop: Chapter 2.8

preview_player
Показать описание

In this video, we take a look at *libraries* and how to use them. We take a look at *standard libraries* in *MicroPython*, how to import *external libraries* in *Thonny*, and we go through an example of finding and using an external *servo library* to drive a servo.

🔧🔨🧰 Hardware featured in this guide:
*Pico:*
*LED Pack:*
*Breadboard:*
*Jumper Wires:*
*Button Pack:*
*Potentiometer:*

0:00 What are Libraries?
0:45 Standard Libraries in MicroPython
1:27 External Libraries
2:50 Installing an External Library in Thonny
4:00 Looking for Documentation
5:20 Plugging in the Servo
6:05 Adapting the Documentation Code
7:04 Importing a Library from a Python File
7:51 Import and From Keywords
9:27 3 Key Takeaways

🌏🦘 *Core Electronics* is located in the heart of Newcastle, Australia. We're powered by makers, for makers. Drop by if you are looking for:

The following trademarks are owned by *Core Electronics Pty Ltd:*

"Core Electronics" and the Core Electronics logo
"Makerverse" and the Makerverse logo
"PiicoDev" and the PiicoDev logo
"GlowBit" and the GlowBit logo
Рекомендации по теме
Комментарии
Автор

Very helpful for me as a beginner, thanks.

djpenton
Автор

For me when I open manage packages it simply does not search for the library, example im trying to search for luma.oled. when i type that i simply get error saying url open timed out. this only occurs when I use micropython for pi pico but doesnt occur when using python 3. Fault in python 3 is that i cannot save anything on the pico if i use it

artisticyeti
Автор

How about

From machine import *

How does that differ from the import examples you showed ?

Keeping_IT_Simple
Автор

tip : thonny lets you copy the whole pico /lib to your pc, no need to enter the lib folder and copy/download each file 1 by 1 !

jyvben