-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInferno.ino
More file actions
54 lines (43 loc) · 950 Bytes
/
Inferno.ino
File metadata and controls
54 lines (43 loc) · 950 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <LittleFS.h>
#include "Webserver.h"
#include "StateManager.h"
#include "Slackbot.h"
#include "WifiControl.h"
#include "LedControl.h"
Webserver webserver;
StateManager stateManager;
void setup()
{
Serial.begin(115200);
WifiControl::setup();
LedControl::setup();
LittleFS.begin();
webserver.setup();
}
bool _wifiConnected;
void loop()
{
WifiControl::update();
if (!WifiControl::connected())
{
LedControl::setMode(FlameMode::Offline);
_wifiConnected = false;
}
else
{
// Reset to flame mode after WiFi is connected
if (!_wifiConnected)
{
LedControl::setMode(FlameMode::Flame);
_wifiConnected = true;
}
// Set default state to monitoring
if (!StateManager::initialised())
{
StateManager::setState(State::Monitor);
}
webserver.handleClient();
Slackbot::update();
}
LedControl::update();
}