Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Multiple OLED Displays Example for SSD13606 SPI - 128x64
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Multiple OLED Displays Example for SSD13606 SPI - 128x64

by msantos_eca on Tue Aug 04, 2020 3:31 pm

Hello,

Please, has someone an example using Multiple OLED Displays SSD13606 SPI - 128x64, with Adafruit_SSD1306 library?
Thank you,
Regards.

Marcelo

msantos_eca
 
Posts: 10
Joined: Tue Aug 04, 2020 1:26 pm

Re: Multiple OLED Displays Example for SSD13606 SPI - 128x64

by mikeysklar on Tue Aug 04, 2020 7:01 pm

Hello Marcelo,

You should be able to to define multiple constructors for each display and just go from there when using SPI:

Code: Select all | TOGGLE FULL SIZE
#define OLED_1_RESET 4
Adafruit_SSD1306 display_1( OLED_1_RESET );

#define OLED_2_RESET 5
Adafruit_SSD1306 display_2( OLED_2_RESET );


Code: Select all | TOGGLE FULL SIZE
display_1.println( 0xDEADBEEF, HEX );
display_2.println( 0xFEEBDAED, HEX );

display_1.display();
display_2.display();


viewtopic.php?f=24&t=125775

mikeysklar
 
Posts: 1644
Joined: Mon Aug 01, 2016 8:10 pm

Re: Multiple OLED Displays Example for SSD13606 SPI - 128x64

by msantos_eca on Tue Aug 04, 2020 8:41 pm

Hello Mike,

It works only 128 x 32... I need 128 x 64.
Regards.

Marcelo

msantos_eca
 
Posts: 10
Joined: Tue Aug 04, 2020 1:26 pm

Re: Multiple OLED Displays Example for SSD13606 SPI - 128x64

by mikeysklar on Wed Aug 05, 2020 10:36 am

Marcelo,

Would you consider using i2c? There is a bitbang library designed from multiple OLEDs.

https://github.com/bitbank2/Multi_OLED

mikeysklar
 
Posts: 1644
Joined: Mon Aug 01, 2016 8:10 pm

Re: Multiple OLED Displays Example for SSD13606 SPI - 128x64

by msantos_eca on Wed Aug 05, 2020 1:41 pm

Very nice tip!!!
By using that library, is it possible to draw Bitmap and lines?

msantos_eca
 
Posts: 10
Joined: Tue Aug 04, 2020 1:26 pm

Re: Multiple OLED Displays Example for SSD13606 SPI - 128x64

by mikeysklar on Wed Aug 05, 2020 5:15 pm

Yes, this library does support loading bitmaps and drawing lines.

Code: Select all | TOGGLE FULL SIZE
// Load a 128x64 1-bpp Windows bitmap
// Pass the pointer to the beginning of the BMP file
// First pass version assumes a full screen bitmap
//
int Multi_OLEDLoadBMP(uint8_t iBus, byte *pBMP);


Code: Select all | TOGGLE FULL SIZE
#include <Multi_BitBang.h>
#include <Multi_OLED.h>

//
// Simple demo to demonstrate line drawing on MCUs with enough RAM to hold
// backing buffers for each display
//
// For this demo, the 2 displays are 1.3" SH1106 controllers with each
// set to a unique address and running from the same I2C bus
//
#define NUM_DISPLAYS 2
#define NUM_BUSES 1
// I2C bus info
uint8_t scl_list[NUM_BUSES] = {5};
uint8_t sda_list[NUM_BUSES] = {6};
int32_t speed_list[NUM_BUSES] = {1000000L};
// OLED display info
uint8_t bus_list[NUM_DISPLAYS] = {0,0}; // can be multiple displays per bus
uint8_t addr_list[NUM_DISPLAYS] = {0x3c, 0x3d};
uint8_t type_list[NUM_DISPLAYS] = {OLED_132x64, OLED_132x64};
uint8_t flip_list[NUM_DISPLAYS] = {0,0};
uint8_t invert_list[NUM_DISPLAYS] = {0,0};

void setup() {
  // put your setup code here, to run once:
  Multi_I2CInit(sda_list, scl_list, speed_list, NUM_BUSES);
  Multi_OLEDInit(bus_list, addr_list, type_list, flip_list, invert_list, NUM_DISPLAYS);
}

void loop() {
  // put your main code here, to run repeatedly:
int i, x1, y1, x2, y2;

  Multi_OLEDFill(0, 0);
  Multi_OLEDFill(1, 0);
  for (i=0; i<128; i++)
  {
    Multi_OLEDDrawLine(0, i, 0, 127-i, 63);
    // draw random lines on the second display
    x1 = random(128);
    x2 = random(128);
    y1 = random(64);
    y2 = random(64);
    Multi_OLEDDrawLine(1, x1, y1, x2, y2);
  }
  delay(2000);
}

mikeysklar
 
Posts: 1644
Joined: Mon Aug 01, 2016 8:10 pm

Re: Multiple OLED Displays Example for SSD13606 SPI - 128x64

by msantos_eca on Wed Aug 05, 2020 7:48 pm

That was a good idea.
But, I got this error while compiling the source.

error.jpg
error.jpg (109.97 KiB) Viewed 38 times



The function is in the source file.
Have you tested it?

msantos_eca
 
Posts: 10
Joined: Tue Aug 04, 2020 1:26 pm

Re: Multiple OLED Displays Example for SSD13606 SPI - 128x64

by mikeysklar on Thu Aug 06, 2020 11:03 am

I've not tried this library.

It looks like it is not finding your Multi_OLED.h header which would defines Multi_OLEDDrawLine().

https://github.com/bitbank2/Multi_OLED/

Try installing the library again. Also this library requires the Multi_BitBang library.

https://github.com/bitbank2/Multi_BitBang

mikeysklar
 
Posts: 1644
Joined: Mon Aug 01, 2016 8:10 pm

Re: Multiple OLED Displays Example for SSD13606 SPI - 128x64

by msantos_eca on Thu Aug 06, 2020 3:57 pm

Hi Mike,

Thanks for your attention.
I have tried with U8glib and it has worked fine.
Thank you so much.
Kind regards.

Marcelo

msantos_eca
 
Posts: 10
Joined: Tue Aug 04, 2020 1:26 pm

Re: Multiple OLED Displays Example for SSD13606 SPI - 128x64

by mikeysklar on Thu Aug 06, 2020 5:37 pm


mikeysklar
 
Posts: 1644
Joined: Mon Aug 01, 2016 8:10 pm

Re: Multiple OLED Displays Example for SSD13606 SPI - 128x64

by msantos_eca on Mon Aug 10, 2020 1:18 pm

Hi Mike,

Sorry responding to you only now.

Yes, it has worked very fine.
Thanks for your help.

Regards,

Marcelo

msantos_eca
 
Posts: 10
Joined: Tue Aug 04, 2020 1:26 pm

Please be positive and constructive with your questions and comments.