File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 14
14
#include < lte.h>
15
15
#include < mcp9808.h>
16
16
#include < mqtt_client.h>
17
+ #include < veml3328.h>
17
18
18
19
#include < Wire.h>
19
20
@@ -230,10 +231,18 @@ void setup() {
230
231
Log.infof (" Starting sandbox / landing page procedure. Version = %s\r\n " ,
231
232
SANDBOX_VERSION);
232
233
233
- if (Mcp9808.begin (0x18 )) {
234
+ if (Mcp9808.begin ()) {
234
235
Log.error (" Could not initialize the temperature sensor" );
235
236
}
236
237
238
+ if (Veml3328.begin ()) {
239
+ Log.error (" Could not initialize the light sensor" );
240
+ }
241
+
242
+ if (Veml3328.wake ()) {
243
+ Log.error (" Could not wake up the light sensor" );
244
+ }
245
+
237
246
ECC608.begin ();
238
247
239
248
// Find the thing ID and set the publish and subscription topics
@@ -434,10 +443,12 @@ void loop() {
434
443
sprintf (transmit_buffer,
435
444
" {\" type\" : \" data\" ,\
436
445
\" data\" : { \
437
- \" Temperature\" : %d \
446
+ \" Temperature\" : %d, \
447
+ \" Red Light\" : %d \
438
448
} \
439
449
}" ,
440
- int (Mcp9808.readTempC ()));
450
+ int (Mcp9808.readTempC ()),
451
+ Veml3328.getRed ());
441
452
442
453
if (!MqttClient.publish (mqtt_pub_topic, transmit_buffer)) {
443
454
Log.errorf (" Could not publish message: %s\r\n " ,
You can’t perform that action at this time.
0 commit comments