Created
October 23, 2019 08:13
-
-
Save KornWtp/2efb603ec72e9ef872a0c82732d8eb49 to your computer and use it in GitHub Desktop.
sim7000-at-bridge.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include <CMMC_NB_IoT.h> | |
#define FONA_PWRKEY 18 | |
#define FONA_RST 5 | |
CMMC_NB_IoT nb; | |
CMMC_AT_Bridge &Bridge = nb.Bridge; | |
// Power on the module | |
void powerOn() { | |
digitalWrite(FONA_PWRKEY, LOW); | |
delay(100); // For SIM7000 | |
digitalWrite(FONA_PWRKEY, HIGH); | |
} | |
void setup() | |
{ | |
Serial.begin(9600); | |
Serial.println(F("*** SIM7000 MQTT Example ***")); | |
pinMode(FONA_RST, OUTPUT); | |
digitalWrite(FONA_RST, HIGH); // Default state | |
pinMode(FONA_PWRKEY, OUTPUT); | |
powerOn(); // Power on the module | |
Serial2.begin(9600); | |
Serial.println("Chiang Mai Maker Club's AT-Bridge engine is started."); | |
Bridge.init(&Serial, &Serial2); | |
} | |
void loop() | |
{ | |
Bridge.loop(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment