Skip to content

Commit 4bc7bfb

Browse files
authored
Merge pull request #2 from sekcompsci/patch-2
Update README.md example code
2 parents 87189a0 + 761b018 commit 4bc7bfb

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

README.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,28 +113,34 @@ char payload[32];
113113
void setup() {
114114
bc95serial.begin(9600);
115115
BC95.begin(bc95serial);
116-
117-
Serial.begin(9600);
118-
Serial.println(F("Starting..."));
119-
120116
BC95.reset();
117+
118+
Serial.begin(9600);
119+
Serial.println(F("Microgear Arduino NB-IoT Start!"));
120+
Serial.print(F("IMEI: "));
121121
Serial.println(BC95.getIMEI());
122+
Serial.print(F("IMSI: "));
122123
Serial.println(BC95.getIMSI());
123124

125+
Serial.print(F("Attach Network..."));
124126
while (!BC95.attachNetwork()) {
125-
Serial.println("...");
127+
Serial.print(".");
126128
delay(1000);
127129
}
128-
Serial.println(F("NB-IOT attached\n RSSI:"));
130+
Serial.println(F("\nNB-IOT attached!"));
131+
Serial.print(F("RSSI: "));
129132
Serial.println(BC95.getSignalStrength());
133+
Serial.print(F("IPAddress: "));
130134
Serial.println(BC95.getIPAddress());
131135

132136
mg.init(APPID, KEY, SECRET);
133137
mg.begin(5555);
134138
}
135139

136140
void loop() {
137-
mg.publish("/nbsensor2/rssi", BC95.getSignalStrength());
141+
mSerial.print(F("Sent Signal Strength: "));
142+
Serial.println(BC95.getSignalStrength());
143+
mg.publish("/nbiot/rssi", BC95.getSignalStrength());
138144
mg.loop();
139145
delay(5000);
140146
}
@@ -172,8 +178,9 @@ void setup() {
172178
BC95.reset();
173179
174180
Serial.begin(9600);
181+
Serial.print(F("Attach Network..."));
175182
while (!BC95.attachNetwork()) {
176-
Serial.println("...");
183+
Serial.print(".");
177184
delay(1000);
178185
}
179186
@@ -225,10 +232,10 @@ void setup() {
225232
Serial.println(F("Starting..."));
226233

227234
while (!BC95.attachNetwork()) {
228-
Serial.println("...");
235+
Serial.print(".");
229236
delay(1000);
230237
}
231-
Serial.println(F("NB-IOT attached.."));
238+
Serial.println(F("\nNB-IOT attached.."));
232239

233240
dns.begin();
234241
dns.getHostByName("google.com", remoteip);
@@ -264,10 +271,10 @@ void setup() {
264271
Serial.println(F("Starting..."));
265272

266273
while (!BC95.attachNetwork()) {
267-
Serial.println("...");
274+
Serial.print(".");
268275
delay(1000);
269276
}
270-
Serial.println(F("NB-IOT attached.."));
277+
Serial.println(F("\nNB-IOT attached.."));
271278

272279
ntpclient.begin();
273280
ntpclient.update();

0 commit comments

Comments
 (0)