-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathsketch.ino
More file actions
37 lines (31 loc) · 1000 Bytes
/
sketch.ino
File metadata and controls
37 lines (31 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//===-- sketch.ino ---------------------------------------------------------===//
// Part of the Startup-Demos Project, under the MIT License
// See https://github.com/qualcomm/Startup-Demos/blob/main/LICENSE.txt
// for license information.
// Copyright (c) Qualcomm Technologies, Inc.
// SPDX-License-Identifier: MIT License
//===----------------------------------------------------------------------===//
#include <Arduino_LED_Matrix.h>
#include <Arduino_RouterBridge.h>
#include "air_quality_frames.h"
Arduino_LED_Matrix matrix;
void setup() {
matrix.begin();
matrix.clear();
Bridge.begin();
matrix.loadFrame(unknown);
}
void loop() {
String helmetStatus;
bool ok = Bridge.call("get_helmet_status").result(helmetStatus);
if (ok) {
if (helmetStatus == "Helmet") {
matrix.loadFrame(good); // ✓
} else if (helmetStatus == "No Helmet") {
matrix.loadFrame(hazardous); // ✗
} else {
matrix.loadFrame(unknown); // ?
}
}
delay(500);
}