-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsiegeOS.ino
More file actions
197 lines (151 loc) · 6.34 KB
/
siegeOS.ino
File metadata and controls
197 lines (151 loc) · 6.34 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#include <LedControl.h>
#include <binary.h>
int lcDIN = 10;
int lcCS = 9;
int lcCLK = 8;
int lc2DIN = 7;
int lc2CS = 6;
int lc2CLK = 5;
LedControl lc = LedControl(lcDIN,lcCLK,lcCS,7); // DIN CLK CS DISPNUM
LedControl lc2 = LedControl(lc2DIN,lc2CLK,lc2CS,7); // DIN CLK CS DISPNUM
int dispBrightness = 15; // Adjust the brightness, maximum is 15
// Display States (Left Side)
byte dispMouth1[8] = {B00100000,B01111000,B11011110,B11000111,B11111111,B00000000,B00000000,B00000000};
byte dispMouth2[8] = {B00000000,B00000000,B00000000,B10000000,B11100000,B01111000,B00011110,B00000111};
byte dispMouth3[8] = {B00000000,B00000000,B00000000,B00000000,B00000111,B00011110,B01111000,B11100000};
byte dispMouth4[8] = {B00000000,B00000000,B00000000,B11100000,B11111000,B00011110,B00000111,B00000001};
byte dispEyeAngry1[8] = {B00000000,B00011111,B00111111,B00111111,B00011111,B00001111,B00000011,B00000000};
byte dispEyeAngry2[8] = {B00000000,B11111100,B11111110,B11111100,B11111000,B11100000,B10000000,B00000000};
byte dispEyeNormal1[8] = {B00001111,B00111111,B01111111,B11111111,B11110000,B01100000,B00000000,B00000000};
byte dispEyeNormal2[8] = {B00000000,B11100000,B11111000,B11111110,B00000111,B00000001,B00000000,B00000000};
byte dispEyeBleep1[8] = {B00000001,B00000111,B00000111,B00001111,B00001111,B00000111,B00000111,B00000001};
byte dispEyeBleep2[8] = {B10000000,B11100000,B11100000,B11110000,B11110000,B11100000,B11100000,B10000000};
byte dispNose[8] = {B00000000,B01111110,B00111111,B00000011,B00000011,B00000001,B00000000,B00000000};
// Display States (Right Side)
byte dispMouth1Mirror[8] = {B00000000,B00000000,B00000000,B00000111,B00011111,B01111000,B11100000,B10000000};
byte dispMouth2Mirror[8] = {B00000000,B00000000,B00000000,B00000000,B11100000,B01111000,B00011110,B00000111};
byte dispMouth3Mirror[8] = {B00000000,B00000000,B00000000,B00000001,B00000111,B00011110,B01111000,B11100000};
byte dispMouth4Mirror[8] = {B00000100,B00011110,B01111011,B11100011,B11111111,B00000000,B00000000,B00000000};
byte dispEyeAngry1Mirror[8] = {B00000000,B00111111,B01111111,B00111111,B00011111,B00000111,B00000001,B00000000};
byte dispEyeAngry2Mirror[8] = {B00000000,B11111000,B11111100,B11111100,B11111000,B11110000,B11000000,B00000000};
byte dispEyeNormal1Mirror[8] = {B00000000,B00000111,B00011111,B01111111,B11100000,B10000000,B00000000,B00000000};
byte dispEyeNormal2Mirror[8] = {B11110000,B11111100,B11111110,B11111111,B00001111,B00000110,B00000000,B00000000};
byte dispEyeBleep1Mirror[8] = {B00000001,B00000111,B00000111,B00001111,B00001111,B00000111,B00000111,B00000001};
byte dispEyeBleep2Mirror[8] = {B10000000,B11100000,B11100000,B11110000,B11110000,B11100000,B11100000,B10000000};
byte dispNoseMirror[8] = {B00000000,B01111110,B11111100,B11000000,B11000000,B10000000,B00000000,B00000000};
void setup(){
Serial.begin(9600);
// -- Display Initialization --
// Display 1
lc.shutdown(0,false);
lc.setIntensity(0,dispBrightness);
lc.clearDisplay(0);
// Display 2
lc.shutdown(1,false);
lc.setIntensity(1,dispBrightness);
lc.clearDisplay(1);
// Display 3
lc.shutdown(2,false);
lc.setIntensity(2,dispBrightness);
lc.clearDisplay(2);
// Display 4
lc.shutdown(3,false);
lc.setIntensity(3,dispBrightness);
lc.clearDisplay(3);
// Display 5
lc.shutdown(4,false);
lc.setIntensity(4,dispBrightness);
lc.clearDisplay(4);
// Display 6
lc.shutdown(5,false);
lc.setIntensity(5,dispBrightness);
lc.clearDisplay(5);
// Display 7
lc.shutdown(6,false);
lc.setIntensity(6,dispBrightness);
lc.clearDisplay(6);
// -- Next Side --
// Display 8
lc2.shutdown(0,false);
lc2.setIntensity(0,dispBrightness);
lc2.clearDisplay(0);
// Display 9
lc2.shutdown(1,false);
lc2.setIntensity(1,dispBrightness);
lc2.clearDisplay(1);
// Display 10
lc2.shutdown(2,false);
lc2.setIntensity(2,dispBrightness);
lc2.clearDisplay(2);
// Display 11
lc2.shutdown(3,false);
lc2.setIntensity(3,dispBrightness);
lc2.clearDisplay(3);
// Display 12
lc2.shutdown(4,false);
lc2.setIntensity(4,dispBrightness);
lc2.clearDisplay(4);
// Display 13
lc2.shutdown(5,false);
lc2.setIntensity(5,dispBrightness);
lc2.clearDisplay(5);
// Display 14
lc2.shutdown(6,false);
lc2.setIntensity(6,dispBrightness);
lc2.clearDisplay(6);
}
void dispByte(int dispNum, byte character [])
{
int i = 0;
for(i=0;i<8;i++)
{
lc.setRow(dispNum,i,character[i]);
}
}
void dispByte2(int dispNum2, byte character [])
{
int i = 0;
for(i=0;i<8;i++)
{
lc2.setRow(dispNum2,i,character[i]);
}
}
void loop(){
Serial.println("[DEBUG] Loop Begin");
// -- DEFAULT --
//Right
dispByte(1,dispMouth1);
dispByte(2,dispMouth2);
dispByte(3,dispMouth3);
dispByte(4,dispMouth4);
dispByte(5,dispEyeNormal1);
dispByte(6,dispEyeNormal2);
dispByte(7,dispNose);
//Left
dispByte2(1,dispMouth1Mirror);
dispByte2(2,dispMouth2Mirror);
dispByte2(3,dispMouth3Mirror);
dispByte2(4,dispMouth4Mirror);
dispByte2(5,dispEyeNormal1Mirror);
dispByte2(6,dispEyeNormal2Mirror);
delay(1000);
Serial.println("[DEBUG] Loop End");
}
/*
Copyright © 2020 Titus Studios Media. To be distributed under the MIT Licence.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/