mikosoft83 / pithy_screen_menu_system

GNU General Public License v3.0
58 stars 9 forks source link

Required changes for 128x128 OLED? #5

Closed gvdhoven closed 2 years ago

gvdhoven commented 2 years ago

Hi, I have an SSD1327 with 128x128 display. Time shows perfectly fine, but appears to show only on the top half. I am wondering about the changes i need to make for the screensaver code to make the time go all over the display;

Currently the (formatted) code looks like this:

          id(ss_x) += id(ss_vx);
          if (id(ss_x)>45 || id(ss_x)<1)
            id(ss_vx) *= -1;

          id(ss_y) += id(ss_vy);
          if (id(ss_y)>29 || id(ss_y)<6)
            id(ss_vy) *= -1;

          id(wi) = ++id(wi) > 15 ? 0 : id(wi); // wait indicator logic

I think i need to modify the Y-values, but i am unsure what the 45/29 and 6 numbers mean, because that part is uncommented.

gvdhoven commented 2 years ago

This modification works btw;

          id(ss_x) += id(ss_vx);
          if (id(ss_x)>50 || id(ss_x)<1)
            id(ss_vx) *= -1;

          id(ss_y) += id(ss_vy);
          if (id(ss_y)>93 || id(ss_y)<1)
            id(ss_vy) *= -1;

          id(wi) = ++id(wi) > 15 ? 0 : id(wi); // wait indicator logic
mikosoft83 commented 2 years ago

Yeah, sorry for the sparse comments, yeah, those are display bounds corrected for the size of the text. Good job on that! There are several other places like that, pretty much all the display code uses hardcoded values for bounds since I assumed the 128x64 display.