Programming the ESP32 in MicroPython


Program Listings



Buy from: Amazon

The ESP32 is a remarkable device. It is low cost but with many different subsystems that make it more powerful than you might think. You can use it for simple applications because it is cheap, but you can also use it for more sophisticated applications because it is capable.
MicroPython is a good choice of language to program the Pico. Although it is a slower language than C, most of the time this doesn’t matter and it is much easier to use. As a high-level language, MicroPython is based on Python 3 and is fully object-oriented. In general, you can take an existing Python 3 program and simply run it under MicroPython. If there are any changes to make, they are generally minor.
Another good thing about MicroPython on the ESP32 is that it is very easy to get started. After a simple installation procedure you have a working MicroPython machine which you can program almost at once using the Thonny IDE or PyCharm which has more extensive syntax checking and input prompting.

The purpose of the book is to reveal what you can do with the ESP's GPIO lines together with widely used sensors, servos and motors and ADCs. After covering the GPIO, outputs and inputs, events and interrupts, it gives you hands-on experience of PWM (Pulse Width Modulation), the SPI bus, the I2C bus and the 1-Wire bus. We also cover direct access to the hardware, adding an SD Card reader, sleep states to save power, the RTC, RMT and touch sensors, not to mention how to use WiFi.
The ESP32 has so many resources that a comprehensive account would fill a book twice this size. In order to make things fit in the space available we have concentrated on things that are accessible from MicroPython and that are basic to getting started. We have avoided “advanced” topics which generally lead the beginner into deep water far too quickly. However, we do cover of use of uasyncio, and asynchronous programming, in general as they are essential to networking.

Jointly authored by Harry Fairhead and Mike James, this book combines Harry’s expertise in electronics and the IoT with Mike’s knowledge of Python. Their previous books include Programming the Raspberry Pi Pico/W in MicroPythonRaspberry Pi IoT In PythonRaspberry Pi IoT In Python Using Linux Drivers while Harry Fairhead is the author of the C language counterparts. His other books include Fundamental C: Getting Closer To The MachineApplying C For The IoT With Linux, and Micro:bit IoT in C. Mike James is the author of theProgrammer's Python: Something Completely Different series of books and several other programming and computer science titles in the I Programmer Library.
  • Publisher ‏ : ‎ I/O Press (June 19, 2023)
  •  Language ‏ : ‎ English
  •  ISBN-10 ‏ : ‎ 187196282X
  •  ISBN-13 ‏ : ‎ 978-1871962826 
  •  Item Weight ‏ : ‎ 1.7 pounds 
  •  Dimensions ‏ : ‎ 7 x 0.8 x 10 inches


  • ASIN ‏ : ‎ B0C8NV75TF
  • Publisher ‏ : ‎ I/O Press;
  • 1st edition (June 19, 2023)
  • Publication date ‏ : ‎ June 19, 2023
  • Language ‏ : ‎ English
  • File size ‏ : ‎ 34826 KB


  • Publisher ‏ : ‎ I/O Press (June 20, 2023)
  • Language ‏ : ‎ English 
  • Hardcover ‏ : ‎ 355 pages 
  • ISBN-10 ‏ : ‎ 1871962099 
  • ISBN-13 ‏ : ‎ 978-1871962093 
  • Item Weight ‏ : ‎ 1.7 pounds 
  • Dimensions ‏ : ‎ 7 x 0.99 x 10 inches