SSD1306 128x32 spi oled breakout; changing the digital pins

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
daveoregon
 
Posts: 31
Joined: Fri Aug 24, 2012 3:27 pm

SSD1306 128x32 spi oled breakout; changing the digital pins

Post by daveoregon »

Hi, I have one of your SSD1306 Monochrome OLED breakout boards working with an ARDUINO Mega. This Mega will eventually have a data logger shield on it, so I don't think I can use digital pins 9-13 for the OLED_MOSI, OLED_CLK, OLED_DC, OLED_CS, and OLED_RESET, respectively. (I understand the logger shield uses digital pins 10-13, no?)

I tried using pins 20,22,24, 26 and 28 instead:
#define OLED_MOSI 20 //this assumes you are using a MEGA!
#define OLED_CLK 22
#define OLED_DC 24
#define OLED_CS 26
#define OLED_RESET 28
Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);


It didn't work. Any advice? I chose those pins on the Mega because they're at the bottom of the board, not likely to adversely interact with the shield at all.

Thanks!

User avatar
Franklin97355
 
Posts: 23912
Joined: Mon Apr 21, 2008 2:33 pm

Re: SSD1306 128x32 spi oled breakout; changing the digital p

Post by Franklin97355 »

You will need to use a software spi library if you move the pins. Try this site for more info http://www.iesensor.com/blog/2013/07/09 ... -mega2560/

User avatar
daveoregon
 
Posts: 31
Joined: Fri Aug 24, 2012 3:27 pm

Re: SSD1306 128x32 spi oled breakout; changing the digital p

Post by daveoregon »

Thanks, but that's not straightforward enough for me to implement at this time.

I think I'll try using a "character LED" shield, which claims to be able to use "Any data pins you want" (https://learn.adafruit.com/character-lc ... racter-lcd)

Does that sound reasonable?

User avatar
Franklin97355
 
Posts: 23912
Joined: Mon Apr 21, 2008 2:33 pm

Re: SSD1306 128x32 spi oled breakout; changing the digital p

Post by Franklin97355 »

Get one of these while you're there, it will make life so much easier. https://www.adafruit.com/products/292

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

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”