ivmarkov / rust-esp32-std-demo

Rust on ESP32 STD demo app. A demo STD binary crate for the ESP32[XX] and ESP-IDF, which connects to WiFi, Ethernet, drives a small HTTP server and draws on a LED screen.
Apache License 2.0
785 stars 105 forks source link

Heltec: OLED doesn't work #158

Open 0x53A opened 9 months ago

0x53A commented 9 months ago

I have a Heltec WiFi LoRa 32 (V3) board, which isn't yet supported by this repository, but it's very similar and I just had to switch a few pins.

When trying to talk to the display, I had a few issues:

1) The display gets completely reset (back to black) at the end of heltec_hello_world(which means you can't see anything). I believe this is because the PinDriver has a Drop implementation that resets the pin - so the RST gets set back to zero, clearing the display. I'm not sure what the best solution is, maybe pulling the driver out to main so it survives longer.

2) After solving that, I had a completely white display instead of the expected text "Hello Rust". This is because in led_draw_customit draws a rectangle with fill=On, so the whole display is already On, and the text writing doesn't show. Two possible solutions are either setting fill=Off or foreground=off, so there's contrast between text and rectangle.