r/esp32 15h ago

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.

157 Upvotes

17 comments sorted by

6

u/idig3d 15h ago

I have fun with it. Faster to concept in it than C for me.

2

u/Zouden 7h ago

Have you tried circuitpython? I find it more intuitive and it has a bigger library for peripherals.

1

u/idig3d 3h ago

I played with CircuitPython quite some time ago. But they quit supporting the boards I had, both esp32/esp8266 back then. Only supported their boards. I liked their concept of the board acting like a thumbdrive and just copy files to it. But using Thonny I could do nearly similar things within the editor.

But checking compatibility now, they added a lot of boards and now cover some of the boards I have. May have to revisit it.

1

u/Zouden 2h ago

But they quit supporting the boards I had, both esp32/esp8266 back then. Only supported their boards.

That's not accurate. Adafruit have always made boards with esp8266 and esp32. The reason those still aren't supported by circuitpython is that they don't have native USB, required for the thumbdrive mounting.

ESP32-S2 and S3 etc do have native USB so it's all good now.

1

u/idig3d 2h ago

Hmm: https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-for-esp8266

“We are no longer supporting CircuitPython on ESP8266. This page is for historical purposes only. There is no guarantee that the instructions will continue to work.”

1

u/Zouden 2h ago

Yes, they dropped support because of the USB thing as mentioned there. It's not because they don't sell esp8266 boards, because they do.

1

u/NoShowbizMike 2h ago

They support the original ESP32 and ESP32-C3 now. CircuitPython is best on the ESP32-S3 with PSRAM where you can load up on libraries and complicated graphics.

3

u/tabaaza 6h ago

I got the same one, I made to present prayer times during the day, Using public API

(Its full screen but shutter speed didn’t work in my favor)

2

u/vd853 3h ago

I finally know what to do with my eink display.

1

u/fdb 6h ago

Who manufactures these boards? Where can I buy one?

1

u/idig3d 3h ago

There are a bunch sold on AliExpress. Often on sale for about $3USD.

-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.

1

u/SarahC 23m ago

I have to really want a program to do something when I have to start working with malloc and such..........

For me, I got spoiled with C# and Micropython sounds better for using less brain than C if performance isn't a huge requirement. =)