forked from Dynatrace/ufo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DisplayCharter.h
64 lines (51 loc) · 1.37 KB
/
DisplayCharter.h
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
57
58
59
60
61
62
#include <ArduinoJson.h>
#include <Adafruit_DotStar.h>
#define RING_LEDCOUNT 15
class DisplayCharter
{
public:
DisplayCharter();
void Init();
void SetLeds(byte pos, byte count, unsigned int color);
void SetBackground(String color);
void SetWhirl(byte wspeed, bool clockwise);
void SetMorph(int period, byte mspeed);
unsigned int ParseLedArg(String argument, unsigned int iPos);
void ParseWhirlArg(String argument);
void ParseMorphArg(String argument);
void Display(Adafruit_DotStar &dotstar);
private:
int GetPixelColor(int i);
private:
unsigned int ledColor[RING_LEDCOUNT];
unsigned int backgroundColor;
byte whirlSpeed;
bool whirlClockwise;
byte offset;
byte whirlTick;
byte morphingState;
int morphPeriod;
int morphPeriodTick;
byte morphSpeed;
byte morphSpeedTick;
byte morphingPercentage;
};
//------------------------------------------------------------------------------------------------------
class IPDisplay
{
public:
IPDisplay();
void ShowIp(String ip, DisplayCharter* displayCh);
void ProcessTick();
void StopShowingIp();
private:
bool showIp;
String ipAddress;
unsigned int pos;
unsigned int tick;
bool shortBreak;
unsigned int color;
unsigned int colorValue;
unsigned int ipspeed;
DisplayCharter* displayCharter;
};