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 1414#include < lte.h>
1515#include < mcp9808.h>
1616#include < mqtt_client.h>
17+ #include < veml3328.h>
1718
1819#include < Wire.h>
1920
@@ -230,10 +231,18 @@ void setup() {
230231 Log.infof (" Starting sandbox / landing page procedure. Version = %s\r\n " ,
231232 SANDBOX_VERSION);
232233
233- if (Mcp9808.begin (0x18 )) {
234+ if (Mcp9808.begin ()) {
234235 Log.error (" Could not initialize the temperature sensor" );
235236 }
236237
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+
237246 ECC608.begin ();
238247
239248 // Find the thing ID and set the publish and subscription topics
@@ -434,10 +443,12 @@ void loop() {
434443 sprintf (transmit_buffer,
435444 " {\" type\" : \" data\" ,\
436445 \" data\" : { \
437- \" Temperature\" : %d \
446+ \" Temperature\" : %d, \
447+ \" Red Light\" : %d \
438448 } \
439449 }" ,
440- int (Mcp9808.readTempC ()));
450+ int (Mcp9808.readTempC ()),
451+ Veml3328.getRed ());
441452
442453 if (!MqttClient.publish (mqtt_pub_topic, transmit_buffer)) {
443454 Log.errorf (" Could not publish message: %s\r\n " ,
You can’t perform that action at this time.
0 commit comments