The Espressif 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.
C is the ideal choice of language to program the ESP32, ensuring that your programs are fast and efficient, and here it is used with the Espressif IoT Development Framework, ESP-IDF and VS Code, a combination which makes it simple to get started and provides a wealth of functions not found elsewhere. The purpose of this book is to reveal what you can do with the ESP32’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), PWM for Motor control, the SPI bus, the I2C bus and the 1-Wire bus, the UARTs and of course WiFi. To round out, it covers direct access to the hardware, adding an SD Card reader, sleep states to save power, the RTC, RMT and touch sensors. It also devotes a chapter to FreeRTOS which takes us into the realm of asynchronous processing. This is not a projects book, although there isn’t much left for you to do to round out the embryonic projects that are used as examples. Instead it is about understanding concepts and the acquisition of skills. The hope is that by the end of the book you will know how to tackle your own projects and get them safely to completion without wasting time in trial and error. Harry Fairhead is the co-author of Programming the ESP32 in MicroPython, but C is his programming language of choice and electronics is his forte. He is the author of Fundamental C: Getting Closer To The Machine and Applying C For The IoT With Linux. His other books on programming single-board computers include Programming the Raspberry Pi Pico/W in C; Raspberry Pi IoT In C; Raspberry Pi IoT in C With Linux Drivers and Micro: bit IoT in C.