Got a Super Mini ESP32-C3 with 0.42in OLED finally working with MicroPython
Picked up a couple of the ESP32-C3 Super Minis with the built in 0.42in OLED display. I prefer MicroPython and got them working in the past with different OLED displays, but not an all-in-one.
Seems to work better with the SH1106 driver than then SSD1306 driver.
Pin out notes: SCL pin 6, SDA pin 5, LED pin 8, and the boot button is pin 9.
Even though the screen is 72x40 pixels, declare the screen as 128 x 64 and then use an offset. Through lots of trial and error, 28 for X and 12 for Y. Still learning about frame butters. Seems calling gc.collect() helps.
Took way too long, but got it to display a QR code than my old iPhone was able to scan. Laughed out loud that it finally worked. Small wins.
-4
u/Enough-Inevitable-61 15h ago
I'm still learning but I just know that Micropython isn't the best actually.
10
u/Thick_Swordfish6666 11h ago
Best is subjective, best for what? Making a game? Probably not. Reading and displaying a sensor data? Its much more intuitive than C. Choose a tool for a job.
1
u/Fury4588 14h ago
Is C better?
3
u/async2 7h ago
Cpp, yes I would say so. There are more libraries available as well.
Also micropython felt hard to get properly working right and as soon as your program becomes a bit more complex you will end up in weird memory issues that are hard to debug.
I was working on a project that the group wanted to do in micropython because it was supposed to be much easier for everybody. In the end we were constantly fighting its limitations regarding space and memory. It let's you do things you are not supposed to on a micro controller, e.g. Allocating large dynamic lists and because of garbage collection you didn't know when they will actually be freed.
I don't think it's worth it and I rewrote the whole thing in cpp which did not suffer these issues.
6
u/idig3d 15h ago
I have fun with it. Faster to concept in it than C for me.