NEW GUIDE: MicroPython Basics: Loading Modules @micropython

 

MicroPython Basics: Loading Modules is a new guide in the learning system:

Extending your scripts by including code from other files is a great way to simplify and structure programs.  Instead of constantly reinventing the wheel for mundane tasks you can put code for them in a Python module or package once and then reuse that code in other scripts.  This way you can focus on what’s important for your project instead of reimplementing trivial details.  Even better by creating modules and packages you can share your code with others so they can benefit from it too!

With MicroPython you can import code in two ways.  One easy way is from Python files on a board’s filesystem just like you would import Python modules & packages on the desktop.  A second way is with ‘frozen modules’ that are baked-in to a build of MicroPython’s firmware and reduce the memory usage of a module vs. importing its raw Python source.  This guide explores how to import modules & packages as both raw Python source files and frozen modules for maximum efficiency.

MicroPython Basics: Loading Modules


Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7:30pm ET! To join, head over to YouTube and check out the show’s live chat and our Discord!

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Join over 38,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

CircuitPython – The easiest way to program microcontrollers – CircuitPython.org


New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — New Products 11/15/2024 Featuring Adafruit bq25185 USB / DC / Solar Charger with 3.3V Buck Board! (Video)

Python for Microcontrollers – Adafruit Daily — Python on Microcontrollers Newsletter: A New Arduino MicroPython Package Manager, How-Tos and Much More! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi

EYE on NPI – Adafruit Daily — EYE on NPI Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

Adafruit IoT Monthly — The 2024 Recap Issue!

Maker Business – Adafruit Daily — Apple to build another chip at TSMC Arizona

Electronics – Adafruit Daily — SMT Tip – Stop moving around!

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !


1 Comment

  1. Richard Collins

    I’m an old school C/C++ guy yet I’m finding Tony’s videos on MicroPython very interesting and have started to try some bits out.

    Thanks for teaching this old dog some new tricks. 😉

Sorry, the comment form is closed at this time.