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);
}