Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Adafruit_FONA.h"
- #define POWER_PIN 22
- #define FONA_RST 23
- Adafruit_FONA fona = Adafruit_FONA(FONA_RST);
- void setupFona() {
- pinMode(POWER_PIN, OUTPUT);
- digitalWrite(POWER_PIN, LOW);
- delay(1000);
- digitalWrite(POWER_PIN, HIGH);
- delay(2000);
- digitalWrite(POWER_PIN, LOW);
- delay(3000);
- Serial1.begin(4800);
- while(!fona.begin(Serial1));
- deleteMessages();
- Serial.println("Setup Fona done");
- }
- boolean sendSMS(String number, String message) {
- return fona.sendSMS(number.c_str(), message.c_str()) ;
- }
- void deleteMessages() {
- int slot = 15;
- while(slot > 0) {
- fona.deleteSMS(slot);
- slot--;
- }
- Serial.println(F("Deleting all messages"));
- }
Advertisement
Add Comment
Please, Sign In to add comment