Skip to content

Commit 66f7b7b

Browse files
author
m19936
committed
Added a cell blink for sandbox
1 parent 7246d98 commit 66f7b7b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The AVR-IoT Cellular Mini is a development board from Microchip to develop cellu
2626

2727
## Examples
2828

29-
A set of examples can be in [src/examples](./src/examples/), and in the respective user guides on the [documentation website](https://iot.microchip.com/docs/arduino/userguide/architecture).
29+
A set of examples can be in [src/examples](./src/examples/), and in the respective user guides on the [documentation website](https://iot.microchip.com/docs/arduino/userguide/architecture).
3030

3131
![](./readme_images/examples.png)
3232

src/examples/sandbox/sandbox.ino

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,23 @@ void setup() {
256256
connectLTE();
257257
}
258258

259+
unsigned long timeLastCellToggle = millis() + 500;
260+
259261
void loop() {
260262

261263
// ----------------------------------------------------------
264+
if (state == NOT_CONNECTED) {
265+
if ((millis() - timeLastCellToggle) > 500) {
266+
LedCtrl.toggle(Led::CELL);
267+
timeLastCellToggle = millis();
268+
}
269+
}
262270

263271
if (event_flags & NETWORK_CONN_FLAG) {
264272
switch (state) {
265273
case NOT_CONNECTED:
266274
state = CONNECTED_TO_NETWORK;
275+
LedCtrl.on(Led::CELL);
267276
Log.infof("Connected to operator: %s\r\n",
268277
Lte.getOperator().c_str());
269278
Log.info("Connecting to MQTT broker...");

0 commit comments

Comments
 (0)