Using multiple Nokia 5110 displays

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
meanpc
 
Posts: 2
Joined: Fri Dec 09, 2011 9:57 am

Using multiple Nokia 5110 displays

Post by meanpc »

Hi,
I've been experimenting with this display and the PCD8554 and GFX libraries. I noticed if I set up two displays, I can choose which screen to dump the buffer to, for example:
leftside.display();
or
rightside.display();

does dump the buffer to the correct screen.

Is there a way to have more than one screen buffer? When I issue a command like:
leftside.drawLine(blahblah);

if I then use
rightside.display();

then the line is there too, telling me it is the same buffer.
The workaround for me so far has been to clear the buffer each time and redraw the entire screen for each display on the SPI bus.

Is there a way to write to a different buffer for each display that I define? I do understand there is around a .5k memory cost for each screen.

User avatar
adafruit_support_bill
 
Posts: 88090
Joined: Sat Feb 07, 2009 10:11 am

Re: Using multiple Nokia 5110 displays

Post by adafruit_support_bill »

It would require a bit of library hacking, but should be possible (although I would recommend using a Mega for more SRAM headroom.)
The buffer is declared at file scope in Adafruit_PCD8544.cpp. If you were to make it a class member and initialize it in the constructor, you would get one buffer per display instance.

meanpc
 
Posts: 2
Joined: Fri Dec 09, 2011 9:57 am

Re: Using multiple Nokia 5110 displays

Post by meanpc »

Thanks, Bill. I wanted to make sure I was experiencing an expected behavior and didn't make a mistake in writing my program, and you confirmed that. I will give what you said a shot and post back here if I get it working. Thanks for your time and direction.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”