Skip to content

Commit 7593110

Browse files
Rocketctfacchinm
authored andcommitted
added GNSS example
1 parent 2aa5b37 commit 7593110

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#include <GSM.h>
2+
3+
REDIRECT_STDOUT_TO(Serial);
4+
5+
#include "arduino_secrets.h"
6+
char pin[] = SECRET_PIN;
7+
char apn[] = SECRET_APN;
8+
char username[] = SECRET_USERNAME;
9+
char pass[] = SECRET_PASSWORD;
10+
11+
void mycallback(char * output);
12+
13+
void setup() {
14+
Serial.begin(115200);
15+
while (!Serial) {}
16+
//GSM.debug(Serial);
17+
Serial.println("\nStarting connection to server...");
18+
GSM.begin(pin, apn, username, pass, CATNB);
19+
Serial.println("\nStarting connection ...");
20+
21+
Serial.println("\nEnable GNSS Engine...");
22+
GSM.beginGNSS(mycallback);
23+
GSM.startGNSS();
24+
}
25+
26+
void loop() {
27+
// GSM.startGNSS();
28+
// delay(10000);
29+
// GSM.stopGNSS();
30+
}
31+
void mycallback(char * output)
32+
{
33+
Serial.println(output);
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#define SECRET_PIN ""
2+
#define SECRET_APN ""
3+
#define SECRET_USERNAME ""
4+
#define SECRET_PASSWORD ""

0 commit comments

Comments
 (0)