Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Nicholas H. Tollervey

Rating No ratings yet

It’s an exciting time to get involved with MicroPython, the re-implementation of Python 3 for microcontrollers and embedded systems. This practical guide delivers the knowledge you need to roll up your sleeves and create exceptional embedded projects with this lean and efficient programming language. If you’re familiar with Python as a programmer, educator, or maker, you’re ready to learn—and have fun along the way. Author Nicholas Tollervey takes you on a journey from first steps to advanced projects. You’ll explore the types of devices that run MicroPython, and examine how the language uses and interacts with hardware to process input, connect to the outside world, communicate wirelessly, make sounds and music, and drive robotics projects. Work with MicroPython on four typical devices: PyBoard, the micro:bit, Adafruit’s Circuit Playground Express, and ESP8266/ESP32 boards Explore a framework that helps you generate, evaluate, and evolve embedded projects that solve real problems Dive into practical MicroPython examples: visual feedback, input and sensing, GPIO, networking, sound and music, and robotics Learn how idiomatic MicroPython helps you express a lot with the minimum of resources Take the next step by getting involved with the Python community

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on guide to running Python 3 on tiny, cheap microcontrollers, taking you from your first blinking LED to networked, musical, and robotic projects. Best for Python programmers, educators, and makers who want to bring their code into the physical world without learning C. 【Book Arc】 - **Opening (~0%–13%)**: Frames what MicroPython is—a lean reimplementation of Python 3 for embedded systems—and why it matters, while laying out the book's roadmap and the four target boards (PyBoard, micro:bit, Circuit Playground Express, ESP8266/ESP32). - **Early (~13%–30%)**: Gets you set up on each board: hardware capabilities, flashing firmware, connecting to the REPL, and the milestone of making an LED blink—the proof that your whole toolchain works. - **Early–Middle (~30%–40%)**: Introduces a framework for thinking about embedded projects (drawing on David Rose's ideas about "enchanted" objects) and walks through board-specific tooling like the micro:bit's browser editor and the Mu editor. - **Middle (~40%–55%)**: Explores the hardware itself—sensors, buttons, NeoPixels, speakers, accelerometers—showing how each board senses and acts on its environment. - **Late (~55%–85%)**: A series of practical example chapters covering visual feedback, input and sensing, GPIO, networking, sound and music, and robotics, all written to be extended into your own projects. - **Ending (~85%–100%)**: Covers idiomatic MicroPython under tight memory and performance constraints (including handling memory errors), then points you toward next steps and the wider Python community. 【Key Takeaways】 - **MicroPython is Python 3, trimmed for microcontrollers** (Early): You keep object orientation (minus metaclasses), core data types and structures, first-class functions, exceptions, generators, comprehensions, and even async/await—so existing Python skills transfer directly. - **Feature availability varies by board** (Early): Modules are ported selectively; the micro:bit ships a cut-down `random`, the ESP8266 uses minimalist `urandom`, and WiFi boards add `json` and `urequests`. Always check what your specific port actually provides. - **"If you can blink an LED, the essentials are in place"** (Early): The book treats a working blink as the gateway milestone—once firmware, code upload, and REPL access all function, everything else is extension. - **Four boards anchor the whole book** (Early–Middle): PyBoard (most powerful, STM32 with floating point), micro:bit (education-focused), Circuit Playground Express (rich onboard sensors and NeoPixels), and ESP8266/ESP32 (WiFi-capable). - **Embedded devices become "enchanted" objects** (Early): Small enough to be sewn, soldered, or screwed onto everyday things, they turn ordinary objects into programmable ones—the book's motivating frame for why this matters. - **Tooling choice affects the learning curve** (Middle): Browser-based flashing for the micro:bit works but was found clunky in testing; Mu offers a friendlier cross-platform editor with direct REPL connection and simple file transfer. - **Constrained environments demand idiomatic code** (Late): Memory errors and performance limits are normal here, and the book dedicates a chapter to squeezing the most out of the microcontroller. - **Community is part of the path forward** (Ending): The conclusion directs readers toward contributing to and joining the MicroPython community as the natural next step. 【Reading Tips】 - **Skim the board-setup chapters for your board only.** If you already own a micro:bit or ESP32, deep-read that section and treat the others as reference—the blink milestone is the same everywhere. - **Deep-read the idiomatic MicroPython chapter even if you're experienced.** Memory management and performance tuning are where embedded Python differs most sharply from desktop Python. - **Treat the example chapters as launchpads, not recipes.** The author explicitly wrote them to be extended; type them in and then modify them rather than copying verbatim. - **Keep the module-availability caveat in mind constantly.** When something doesn't work, check whether your port implements it before debugging your own code. - **Don't skip the project-thinking framework.** It's easy to dismiss as philosophy, but it's the book's tool for turning toy examples into projects that solve real problems. 【Coverage Limits】 These excerpts cover the book's structure, rationale, board overviews, and tooling, but do not include the actual code walkthroughs from the visual feedback, networking, sound, or robotics chapters, nor the detailed contents of the idiomatic MicroPython chapter.
Page 5
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Why Micro? 2 Why Python? 4 MicroPython Genesis 9 Dive In! 12 2. PyBoard. . . . . . ....
View in text
Excerpt 2
s) and data structures (like lists, sets, and dictionaries) • The highly dynamic nature of Python objects • Functions as first-class objects • Exception hand...
View in text
Excerpt 3
sor covering the entire screen (see Figure 2-2). Figure 2-2. The colour LCD display The Hardware | 17 If you have more than one DFU-capable device attached t...
View in text
Excerpt 4
y can gravity be sensed but also tilt, motion, and gestures. Below button B is a small microphone to detect audio levels by turning sound waves into electric...
View in text
Excerpt 5
e hype is reflective, grounded, and critical thinking. Such an outlook is essential for identifying and evaluating opportunities to solve important problems...
View in text
Excerpt 6
UND WATSCHEN DER BLINKENLICHTEN”. Interestingly, the German Chaos Computer Club created project blinkenlights, which turned the windows of a high-rise block...
View in text
Excerpt 7
retro-monochrome, green-screen monitor! How 1337 is that?6 Not as 1337 as piping the REPL to the display: >>> import lcd160cr >>> import pyb >>> lcd = lcd160...
View in text
Excerpt 8
ame”; freefall is probably an indication that the device is in the process of being dropped, so prepare for a crash landing; and face up may just mean displa...
View in text
Tags
AI categories
Programming LanguagePythonIoT
ISBN: 1491972734
Publisher: O’Reilly Media
Publish Year: 2017
Language: English
Pages: 214
File Format: PDF
File Size: 17.1 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…