Horizontal offset issue with screen (goes away with older Arduboy library)

I recently upgraded my homemade Arduboy to use a 2.42 inch OLED screen run with SPI and the 1309 chipset off my Arduino Micro (not ProMicro). Here is the new screen I’m using:

I’m encountering a strange issue. If I upload code (using Mr. Blinky’s Homemade Arduboy package configured for SSD1309) that was compiled with the original Arduboy.h library, it works fine.

If I upload code complied using the Arduboy2.h library, everything displayed on the screen is offset to the right and wraps around (e.g., as if x=0 is now in the middle of the screen).

Here’s a screenshot of me running the exact same simple Hello World program. The only difference between the code generating these two examples is that I swapped in Arduboy2 for Arudoboy in the include statement and the initialization of the arduboy object.

This feels like an issue that has probably come up before. Maybe there’s something old about my screen, or I’m missing an update to the Mr Blinky package, etc. So I thought I would ask before going farther…

Small additional detail: when I’m compiling and uploading a program using Arduboy.h, it doesn’t seem to matter whether or not I correctly select the 1309 chipset in the display menu for the Homemade Arduboy board: 1106 and 1306 also work fine.
On the flip side, when uploading a program that uses Arduboy2.h, even when I correctyl select 1309 it acts as if I didn’t.

I found an earlier thread on the forum where someone had the exact same display problem with a 2.42 inch screen using the 1309 chipset. The solution, offered by @MrBlinky, was to use his homemade board and select 1309 as the display, which resolved the problem.

So it almost seems almost like the Homemade Arduboy board isn’t properly updating the hex for the 1309 driver on my machine?

Definitely curious…very interested to find out what’s happening here…

Fore some reason your reference to @Mr.Blinky did not seem to work.

It’s because @cnewport left the . out: it should be @Mr.Blinky, not @MrBlinky

Sounds like there is a copy of Arduboy2 library installed manually or through the library manager. Go to your sketchbook library folder and delete the Arduboy2 library there.

Mr.Blinky like’s dots too :slight_smile:

2 Likes

I had indeed installed Arduboy2 manually way back when I originally messing around with a homemade Arduboy. Moving that folder out of my libraries subdirectory seemed to do the trick!

In the interest of understanding why this worked, however, I was hoping to indulge the board here with a pair of follow-up questions:

  1. Is this understanding correct: The Homemade Arduboy board installation includes its own copy of Arduboy2 that it knows exactly how to work with, and by installing my own copy, I overrode the board version with a slightly different version, preventing the 1309-related patches from functioning properly?

  2. The other confusing thing to me is that code compiled with the original Arudoboy library seemed to display fine on my 1309 screen, even if I was using the Homemade Arduboy board with the wrong screen driver selected. Is there a standard explanation for that?

  1. Yes as mentioned here if you have the option ‘show verbose output during compilation’ enabled in preferences you can can read in the log which library it uses.

  2. Arduboy and Arduboy2 are two different libraries. You didn’t had the original Arduboy library installed (manually). If you had you would experience the same problem.

Yeah. Correct me if I’m wrong but it changes some pins and “brings some of them out?” (that’s what I heard last time I was learning to use it)

It does a bit more then that. But in a nutshell:

The homemade package selected options will create some special defines that are passed on to the compilers preprocessor.

These defines are used in the modified libraries to tell the preprocessor which code should be compiled.

1 Like

It’s been a while since I took compilers back in college, but this actually does make sense to me! Very interesting…