FONA won't play nicely with OLED Displays

Adafruit cellular platform - SMS and IoT over celluar

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jgowa
 
Posts: 20
Joined: Tue Oct 21, 2014 5:08 pm

FONA won't play nicely with OLED Displays

Post by jgowa »

Maybe vice versa. With both devices hooked up, the FONA example with proper pins relabeled and OLED example with proper pins relabeled works fine.

Together the code hangs and will not make a call on the FONA.

Commenting this line out enables a call to be made-- all pins are correct, with the line in, the program seems to hang and FONA is never functions...

'Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);'

Any ideas?

Code: Select all

#include <SoftwareSerial.h>
#include "Adafruit_FONA.h"
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define FONA_RX 5
#define FONA_TX 6
#define FONA_RST 4
#define OLED_MOSI   7
#define OLED_CLK   8
#define OLED_DC    9
#define OLED_CS    11
#define OLED_RESET 10
Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

SoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);
Adafruit_FONA fona = Adafruit_FONA(&fonaSS, FONA_RST);
void setup(){
   if (! fona.begin(4800)) {  
    Serial.println(F("Couldn't find FONA"));
    while (1);
  }
  Serial.println(F("FONA is OK"));

 

fona.setAudio(FONA_EXTAUDIO);
pinMode(0,INPUT_PULLUP);

}
void loop(){
if (digitalRead(0)==LOW)
{


  char number[30];
  number=="REMOVED FOR FORUMS";
  fona.callPhone("REMOVED FOR FORUMS");
}
  else
digitalWrite(13,HIGH);
}

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

Re: FONA won't play nicely with OLED Displays

Post by adafruit_support_bill »

You may have a memory problem. OLEDs require a large frame buffer in SRAM. This guide has tips on diagnosing memory issues and optimizing memory usage.
http://learn.adafruit.com/memories-of-an-arduino

User avatar
jgowa
 
Posts: 20
Joined: Tue Oct 21, 2014 5:08 pm

Re: FONA won't play nicely with OLED Displays

Post by jgowa »

adafruit_support_bill wrote:You may have a memory problem. OLEDs require a large frame buffer in SRAM. This guide has tips on diagnosing memory issues and optimizing memory usage.
http://learn.adafruit.com/memories-of-an-arduino
Ok would this correct itself simply by removing commenting out the noted command? I'm working through the tutorial now.

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

Re: FONA won't play nicely with OLED Displays

Post by adafruit_support_bill »

I'm not familiar with the FONA library internals. But instantiating an OLED display will allocate a large chunk of SRAM.

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

Return to “FONA”