Go Down

Topic: Multiple SPD0301 Screens with U8glib (Read 458 times) previous topic - next topic


Hi Guys

I was able to hack one of the ssd1306 devices to work with my 72x32 spd0301 based screen from the the spd0301 datasheet. The next step has been trying to get it to work with multiple screens at once. It works well with 2 screens, but starts to glitch up with the 3rd screen (See photo). I'm really not sure about U8glib's backend, but I suspect its my modified file that causing the issue here. I've been able to wire up 3 SSD1306 screens with no problem.

The only solution I have been able to come up with so far is inserting a begin() statement before each screen draw but this causes massive latency with all my screens. Not sure why this is happening, maybe its an issue with the frame buffer and my screen?

Code: [Select]

#include <U8glib.h>
#include "pin_definitions.h"
#include "PinInit.h"
#include "icons.h"

PinInit pininit();

U8GLIB_SSD1306_128X32 screen_1_1  (SCREEN_CS_1_1,  SCREEN_DC, SCREEN_SPI_RESET);
U8GLIB_SSD1306_128X32 screen_1_2  (SCREEN_CS_1_2,  SCREEN_DC);
U8GLIB_SSD1306_128X32 screen_1_3  (SCREEN_CS_1_3,  SCREEN_DC);

void setup(void)
  //setup the font                         //setup the color index
  screen_1_1.setFont(u8g_font_unifontr);   screen_1_1.setColorIndex(1);
  screen_1_2.setFont(u8g_font_unifontr);   screen_1_2.setColorIndex(1);
  screen_1_3.setFont(u8g_font_unifontr);   screen_1_3.setColorIndex(1);

void loop(void)
  drawText_screen_1_1 ();
  drawText_screen_1_2 ();
  drawText_screen_1_3 ();

  delay (1000);

  drawIcon_screen_1_1 ();
  drawIcon_screen_1_2 ();
  drawIcon_screen_1_3 ();

  delay (1000);

void drawIcon_screen_1_1 ()  { screen_1_1.firstPage(); do screen_1_1.drawXBMP( 20, 0, icon_width, icon_height, icon_01); while (screen_1_1.nextPage());}
void drawIcon_screen_1_2 ()  { screen_1_2.firstPage(); do screen_1_2.drawXBMP( 20, 0, icon_width, icon_height, icon_01); while (screen_1_2.nextPage());}
void drawIcon_screen_1_3 ()  { screen_1_3.firstPage(); do screen_1_3.drawXBMP( 20, 0, icon_width, icon_height, icon_01); while (screen_1_3.nextPage());}

void drawText_screen_1_1 ()  { screen_1_1.firstPage(); do screen_1_1.drawStr( 24, 20, "Hi"); while (screen_1_1.nextPage());}
void drawText_screen_1_2 ()  { screen_1_2.firstPage(); do screen_1_2.drawStr( 24, 20, "Hello");  while (screen_1_2.nextPage());}
void drawText_screen_1_3 ()  { screen_1_3.firstPage(); do screen_1_3.drawStr( 24, 20, "Howdy");  while (screen_1_3.nextPage());}


Go Up