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

Instantiate Adafruit Screen objects
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Instantiate Adafruit Screen objects

by chuckinfruit on Thu Aug 06, 2020 3:43 pm

Hi there ! I'm working on a multi spi oled screen to easy a bit my code I'd like to instantiate the Adafruit declaration of the different screen.

So far, I wrote something like :

Code: Select all | TOGGLE FULL SIZE
Adafruit_SSD1331 display[PARAM_AMOUNT] = {Adafruit_SSD1331(&SPI, cs, dc, rst), Adafruit_SSD1331(&SPI, cs2, dc2, rst2)};


where PARAM_AMOUNT is 2 but even though it compiles, I get stuck when executing some of the methods. The program seems not to comply the method it's executing.
For instance, it gets stuck in the void setup function whenever I init with a for loop the screen like that:

Code: Select all | TOGGLE FULL SIZE
for (int i = 0; i <= 1; i++){
    display[i].begin();
    display[i].fillScreen(BLACK);
   }


Thanks for your help !

chuckinfruit
 
Posts: 3
Joined: Thu Aug 06, 2020 3:36 pm

Re: Instantiate Adafruit Screen objects

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

What processor are you using?

adafruit_support_bill
 
Posts: 78733
Joined: Sat Feb 07, 2009 10:11 am

Re: Instantiate Adafruit Screen objects

by chuckinfruit on Fri Aug 07, 2020 3:59 am

Hi, i'm using either a Teensy 4 or a Arduino Uno so MIMXRT1062 or ATMega328P.

chuckinfruit
 
Posts: 3
Joined: Thu Aug 06, 2020 3:36 pm

Re: Instantiate Adafruit Screen objects

by adafruit_support_bill on Fri Aug 07, 2020 5:59 am

Those are 2 very different processors. 2 displays on an UNO is likely to exceed the available memory. Are you seeing the same problem running on the Teensy?

adafruit_support_bill
 
Posts: 78733
Joined: Sat Feb 07, 2009 10:11 am

Re: Instantiate Adafruit Screen objects

by chuckinfruit on Fri Aug 07, 2020 7:50 am

Yes I actually checked on teensy. It did not work until this morning and things seem to run ok since then. I guess problem solved :)

chuckinfruit
 
Posts: 3
Joined: Thu Aug 06, 2020 3:36 pm

Re: Instantiate Adafruit Screen objects

by adafruit_support_bill on Fri Aug 07, 2020 8:13 am

Good to hear it is working. Thanks for the update.

adafruit_support_bill
 
Posts: 78733
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.