-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathFlora_controller.ino
56 lines (42 loc) · 1.47 KB
/
Flora_controller.ino
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
55
56
#include <Adafruit_GFX.h>
#include <adafruit_1947_Obj.h>
#include "Fonts/FreeSans9pt7b.h"
//#include "Fonts/Serif12.h"
#include <colorObj.h>
#include <idlers.h>
#include <lists.h>
#include <mapper.h>
#include <drawObj.h>
#include <screen.h>
#include <lilOS.h>
#include "floraOS.h"
void bootError(char* errStr) {
screen->fillScreen(&black); // Fill the screen black.
screen->setCursor(10,10); // Move cursor to the top left.
screen->setTextColor(&white); // Drawing in white..
screen->setTextSize(2); // Big enought to notice.
screen->drawText(errStr); // Draw the error message.
//analogWrite(SCREEN_PIN,0); // Bring up the screen.
while(1); // Lock down.
}
void setup() {
// First bring the screen online.
if (!initScreen(ADAFRUIT_1947,ADA_1947_SHIELD_CS,PORTRAIT)) {
Serial.println("NO SCREEN!");
Serial.flush();
//while(true);
}
screen->fillScreen(&black);
if (!SD.begin(ADA_1947_SHIELD_SDCS)) { // With icons, we now MUST have an SD card.
Serial.println("NO SD CARD!");
Serial.flush();
bootError("No SD card.");
}
ourEventMgr.begin(); // Kickstart our event manager.
// Hardware and services are up and running.
ourOS.begin(); // Boot OS manager.
}
void loop() { // During loop..
idle(); // Idlers get their time.
ourOS.loop(); // ourOS gets a kick to pass on to the current panel.
}