33 *
44 * MANAGER MUST BE INCLUDED FIRST IN ALL CODE
55 */
6- #include " arduino_secrets.h"
76
7+ #include " arduino_secrets.h"
88#include < Loom_Manager.h>
9-
109#include < Hardware/Loom_Hypnos/Loom_Hypnos.h>
1110#include < Internet/Connectivity/Loom_LTE/Loom_LTE.h>
1211#include < Internet/Logging/Loom_MongoDB/Loom_MongoDB.h>
12+ #include < Sensors/Loom_Analog/Loom_Analog.h>
13+
1314
1415Manager manager (" Device" , 1 );
1516
1617Loom_Hypnos hypnos (manager, HYPNOS_VERSION ::V3_3 , TIME_ZONE ::PST );
1718
1819Loom_LTE lte (manager, NETWORK_NAME , NETWORK_USER , NETWORK_PASS );
19- Loom_MongoDB mqtt (manager, lte.getClient(), SECRET_BROKER, SECRET_PORT, DATABASE, BROKER_USER, BROKER_PASS, PROJECT);
20+
21+ Loom_MongoDB mqtt (manager, lte, SECRET_BROKER , SECRET_PORT , DATABASE , BROKER_USER , BROKER_PASS , PROJECT );
22+
23+ Loom_Analog analog (manager);
2024
2125// Enables batch logging with a batch size of 15
2226Loom_BatchSD batchSD (hypnos, 15 );
2327
28+
2429// Called when the interrupt is triggered
25- void isrTrigger (){
30+ void isrTrigger ()
31+ {
2632 hypnos.wakeup ();
2733}
2834
29- void setup () {
3035
36+ void setup ()
37+ {
3138 // Start serial
3239 manager.beginSerial ();
3340
@@ -42,15 +49,16 @@ void setup() {
4249
4350 // Register the ISR and attach to the interrupt
4451 hypnos.registerInterrupt (isrTrigger);
45-
4652}
4753
48- void loop () {
54+
55+ void loop ()
56+ {
4957 // Set the RTC interrupt alarm to wake the device in 10 seconds
5058 hypnos.setInterruptDuration (TimeSpan (0 , 0 , 0 , 10 ));
5159
5260 // Measure data from connected sensors
53- manager.measure ()
61+ manager.measure ();
5462
5563 // Package data
5664 manager.package ();
@@ -64,8 +72,6 @@ void loop() {
6472 // Pass batch SD along to the MQTT module
6573 mqtt.publish (batchSD);
6674
67-
68-
6975 // Reattach to the interrupt after we have set the alarm so we can have repeat triggers
7076 hypnos.reattachRTCInterrupt ();
7177
0 commit comments