-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
39 lines (30 loc) · 902 Bytes
/
main.cpp
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
#include <ArduinoLog.h>
#include "constants.h"
#include "controller.h"
#ifdef BLUETOOTH_SERIAL
#include <BluetoothSerial.h>
BluetoothSerial SerialBT;
#endif
// ----------------------------------------
// Global Controller instance. To access it, add `extern Controller controller` to the top of your cpp file.
// Alternatively, a singleton could be used, but the result is the same.
Controller controller;
// ----------------------------------------
void setup()
{
Serial.begin(115200);
// Log level should be "LOG_LEVEL_VERBOSE" for debugging, and "LOG_LEVEL_ERROR" for production code.
Log.begin(LOG_LEVEL_ERROR, &Serial);
#ifdef BLUETOOTH_SERIAL
SerialBT.begin("Microfluidics control system");
#endif
// Wait for serial to attach
while (!Serial);
#ifdef NEOPIXELS
controller.initNeoPixelStrip();
#endif
}
void loop()
{
controller.update();
}