Flipping OLED (Well, rotating)

Heyo! I am once again attempting to use C++ instead of Arduino after running head-first into some speed issues and also seeing a post on Reddit that said

Arduino libraries on an STM32F4 is like putting training wheels on a Ducati

To be fair, I know the Daisy uses a F7, but the point stands.
I think that I could actually get the system working pretty easily for me, but I am facing one pretty noticeable hurdle–My screen is upside-down. Now you’re probably asking yourself “well, why don’t you just flip the screen?” The short answer is I don’t wanna. The longer and probably more helpful answer is that it just fits onto my protoboard significantly better.

However, this causes everything to display upside-down. Normally a library like u8g2 includes features to use the screen’s built-in flipping (or, well, technically rotating) functions to solve this problem, but sadly it seems like Libdaisy has no such built-in solution for SSD OLEDs. Is there anyone who knows how I could solve this? Or even someone who could add the function to Libdaisy?? HUGE thanks in advance y’all :slight_smile:

Hi North!

I’m really sorry for the delay in response.

That is indeed a feature that we’re missing in the libdaisy display code at the moment.
It would probably look something like adding a rotation setter to display.h.

A more “hacky” option that would probably be quicker is to mess with oled_ssd130x.h to flip the dat at send time. Basically hack SendData to send the data in reverse order. I think that would work, and you could just leave those changes on your local libdaisy copy.

Heyo! This is actually a really good idea, and I decided to take it a step further and just send the command to the screen to draw in reverse order. However, I am not very versed in C++ and it’s common goings-on yet, so I’m having some issue actually having my edits in the header file actually apply to the code that is accessing it in the DaisyExamples folder. I’ve tried “task build_all” and even the .sh file in the main directory but nothing seems to work. Any ideas?

Hi North!

What changes did you make in the oled_ssd130x.h file so far? Those edits should reflect when you build and flash as far as I know.

I hope to look into this further tomorrow (EST time). I would be happy to set up the OLED with the Seed and troubleshoot this with you :slight_smile:

I was hoping to set it up today but things came up, so I really appreciate your patience.

Hey again North!

Scratch part of what I said in my previous message, I’m sorry.

We do need to recompile libDaisy after making edits to the .h file.
So, after editing an .h file, you would need to run build_libdaisy before running either the build_and_program or build_and_program_dfu to flash (I’m assuming you’re using VS Code).

Please keep me posted and I hope to look at this further with you early next week if you have any questions.