-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finalized google sheets integration, NTP sync module, and publish pla…
…tform
- Loading branch information
1 parent
78c6d4a
commit 1229b57
Showing
8 changed files
with
238 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
#include <Loom.h> | ||
|
||
// Fill out the config with your google sheets values | ||
const char* json_config_pretty = | ||
#include "json_config_pretty.h" | ||
; | ||
|
||
|
||
LoomManager Manager("Manager", "Loom", 1, 1, DeviceType::NODE, Verbosity::V_HIGH, Verbosity::V_LOW); | ||
|
||
void setup() | ||
{ | ||
pinMode(LED_BUILTIN, OUTPUT); // Set the LED pin mode | ||
|
||
Serial.begin(115200); | ||
while(!Serial); // Ensure Serial is ready to go before anything happens in LOOM_DEBUG mode. | ||
delay(1000); | ||
|
||
LPrintln("Initialized Serial!\n"); | ||
|
||
LPrintln("\nConfig:\n", json_config_pretty, "\n"); | ||
|
||
Manager.parse_config(json_config_pretty); | ||
Manager.print_config(); | ||
|
||
LPrintln("strlen json_config_pretty ", strlen(json_config_pretty)); | ||
|
||
LPrintln("\n ** Setup Complete ** "); | ||
} | ||
|
||
|
||
|
||
void loop() | ||
{ | ||
Manager.measure(); | ||
|
||
JsonObject j = Manager.package(); | ||
|
||
Manager.publish(j); | ||
|
||
serializeJsonPretty(j, Serial); | ||
Serial.println(); | ||
|
||
delay(10000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
"{\ | ||
'general':\ | ||
{\ | ||
'device_name':'Device',\ | ||
'family':'Loom',\ | ||
'instance_num':1,\ | ||
'family_num':0\ | ||
},\ | ||
'components':[\ | ||
{\ | ||
'name':'Loom_Analog',\ | ||
'parameters':[\ | ||
'Analog',\ | ||
8,\ | ||
12,\ | ||
true,\ | ||
true,\ | ||
true,\ | ||
true,\ | ||
true,\ | ||
true,\ | ||
0,\ | ||
0,\ | ||
0,\ | ||
0,\ | ||
0,\ | ||
0\ | ||
]\ | ||
},\ | ||
{\ | ||
'name':'Loom_Digital',\ | ||
'parameters':[\ | ||
'Digital',\ | ||
true,\ | ||
true,\ | ||
false,\ | ||
false,\ | ||
false,\ | ||
false,\ | ||
false,\ | ||
false,\ | ||
false,\ | ||
false,\ | ||
false,\ | ||
false\ | ||
]\ | ||
},\ | ||
{\ | ||
'name':'Loom_Ethernet',\ | ||
'parameters':[\ | ||
'Ether1',\ | ||
[<your-mac-address>],\ | ||
[192,168,0,1]\ | ||
]\ | ||
},\ | ||
{\ | ||
'name':'Loom_DS3231',\ | ||
'parameters':[\ | ||
'RTC1',\ | ||
12,\ | ||
true,\ | ||
false,\ | ||
6\ | ||
]\ | ||
},\ | ||
{\ | ||
'name':'Loom_NTP_Sync',\ | ||
'parameters':[\ | ||
'NTP1',\ | ||
0,\ | ||
0\ | ||
]\ | ||
},\ | ||
{\ | ||
'name':'Loom_GoogleSheets',\ | ||
'parameters':[\ | ||
'Goog',\ | ||
0,\ | ||
'/macros/s/<your-url>/exec',\ | ||
'<your-sheet-id',\ | ||
'<your-Tab-id>',\ | ||
'<your-device-id>'\ | ||
]\ | ||
},\ | ||
{\ | ||
'name':'Loom_Interrupt_Manager',\ | ||
'parameters':[\ | ||
'Interrupt-Manager',\ | ||
0\ | ||
]\ | ||
}\ | ||
]\ | ||
}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.