I thought I'd share this little beginner project I made using the ESP32 microcontroller and a Waveshare ePaper display. What you will learn: basic C++ classes, Arduino String class, randomised data including string construction, displaying of bitmaps on ePaper panels, sleep and wake up ESP32. It's a nice idea for a school or university microcontroller project. You don't have to use anime dolls - you could use anything else that has a social media presence.
00:00 - Introduction
01:07 - Code walkthrough
01:52 - Fonts
02:18 - Bitmap images
02:46 - ESP32 randomizer
03:30 - C++ classes
04:20 - Random messages
05:32 - Sleep the ESP32
05:48 - Random element from array
06:40 - Drawing on ePaper display
08:07 - Word wrapping text
09:04 - Random strings
09:30 - String library problems
All you need make this device is an ESP32, a Waveshare ePaper display and The Gimp freeware graphics package. Libraries used include the Adafruit Gfx library and the GxEDP2 ePaper library. The Waveshare display I'm using is the 3.7 inch 280x480 pixel monochrome panel.
Important: due to the extensive use of the String class DO NOT use delay() in this Sketch. I should really use char arrays rather than the String class but I'm a C++ noob. There's still a Guru Meditation issue with the ESP32 crashing when attempting to sleep. If I resolve the issue I'll post an update. In general embedded C isn't really the greatest programming language for doing a lot of string manipulation as it shreds the memory. It may (or may not) be better to use Python instead.
My code's github repository:
https://github.com/nichelaboratory/GxEPD2-Random-ePaper-Social-Media-PostsESP32 random number seeding:
https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/random.htmlIncidentally the device is modelled by Dollfie Dream Ciel from Type Moon/Tsukihime. She's 1:3 sized so the Waveshare panels make excellent doll-sized Kindle eBook readers.
Easy ESP32 ePaper tutorial:
https://youtu.be/El38zVmog14How to draw bitmaps on ePaper displays:
https://youtu.be/lzvnwu5lNvo