FastLED 3.9.7
Loading...
Searching...
No Matches
mapping.h
1/*
2 * Maps hex topology onto LED's
3 * (C) Voidstar Lab LLC 2021
4 */
5
6#ifndef MAPPING_H_
7#define MAPPING_H_
8
9// I accidentally noted these down 1-indexed and I'm too tired to adjust them
10#define headof(S) ((S - 1) * 14)
11#define tailof(S) (headof(S) + 13)
12
13// Beam 0 is at 12:00 and advance clockwise
14// -1 means nothing connected on that side
15int nodeConnections[25][6] = {
16 {-1, -1, 1, -1, 0, -1},
17 {-1, -1, 3, -1, 2, -1},
18 {-1, -1, 5, -1, 4, -1},
19 {-1, 0, 6, 12, -1, -1},
20 {-1, 2, 8, 14, 7, 1},
21
22 {-1, 4, 10, 16, 9, 3},
23 {-1, -1, -1, 18, 11, 5},
24 {-1, 7, -1, 13, -1, 6},
25 {-1, 9, -1, 15, -1, 8},
26 {-1, 11, -1, 17, -1, 10},
27
28 {12, -1, 19, -1, -1, -1},
29 {14, -1, 21, -1, 20, -1},
30 {16, -1, 23, -1, 22, -1},
31 {18, -1, -1, -1, 24, -1},
32 {13, 20, 25, 29, -1, -1},
33
34 {15, 22, 27, 31, 26, 21},
35 {17, 24, -1, 33, 28, 23},
36 {-1, 26, -1, 30, -1, 25},
37 {-1, 28, -1, 32, -1, 27},
38 {29, -1, 34, -1, -1, -1},
39
40 {31, -1, 36, -1, 35, -1},
41 {33, -1, -1, -1, 37, -1},
42 {30, 35, 38, -1, -1, 34},
43 {32, 37, -1, -1, 39, 36},
44 {-1, 39, -1, -1, -1, 38}
45};
46
47// First member: Node closer to ceiling
48// Second: Node closer to floor
49int segmentConnections[40][2] = {
50 {0, 3},
51 {0, 4},
52 {1, 4},
53 {1, 5},
54 {2, 5},
55 {2, 6},
56 {3, 7},
57 {4, 7},
58 {4, 8},
59 {5, 8},
60 {5, 9},
61 {6, 9}, // ayy
62 {3, 10},
63 {7, 14},
64 {4, 11},
65 {8, 15},
66 {5, 12},
67 {9, 16},
68 {6, 13},
69 {10, 14},
70 {11, 14},
71 {11, 15},
72 {12, 15},
73 {12, 16},
74 {13, 16},
75 {14, 17},
76 {15, 17},
77 {15, 18},
78 {16, 18},
79 {14, 19},
80 {17, 22},
81 {15, 20},
82 {18, 23},
83 {16, 21},
84 {19, 22},
85 {20, 22},
86 {20, 23},
87 {21, 23},
88 {22, 24},
89 {23, 24}
90};
91
92// First member: Strip number
93// Second: LED index closer to ceiling
94// Third: LED index closer to floor
95int ledAssignments[40][3] = {
96 {2, headof(3), tailof(3)},
97 {2, tailof(2), headof(2)},
98 {1, headof(10), tailof(10)},
99 {1, tailof(9), headof(9)},
100 {1, headof(4), tailof(4)},
101 {1, tailof(3), headof(3)},
102
103 {2, tailof(6), headof(6)},
104 {3, tailof(11), headof(11)},
105 {1, headof(11), tailof(11)},
106 {1, tailof(8), headof(8)},
107 {1, headof(12), tailof(12)},
108 {0, tailof(11), headof(11)},
109
110 {2, headof(4), tailof(4)},
111 {3, tailof(10), headof(10)},
112 {2, tailof(1), headof(1)},
113 {1, tailof(7), headof(7)},
114 {1, headof(5), tailof(5)},
115 {0, tailof(10), headof(10)},
116 {1, tailof(2), headof(2)},
117
118 {2, headof(5), tailof(5)},
119 {3, tailof(4), headof(4)},
120 {3, headof(5), tailof(5)},
121 {0, headof(5), tailof(5)},
122 {0, tailof(4), headof(4)},
123 {1, tailof(1), headof(1)},
124
125 {3, tailof(9), headof(9)},
126 {0, headof(6), tailof(6)},
127 {1, tailof(6), headof(6)},
128 {0, tailof(9), headof(9)},
129
130 {3, tailof(3), headof(3)},
131 {3, tailof(8), headof(8)},
132 {3, headof(6), tailof(6)},
133 {0, tailof(8), headof(8)},
134 {0, tailof(3), headof(3)},
135
136 {3, tailof(2), headof(2)},
137 {3, headof(7), tailof(7)},
138 {0, headof(7), tailof(7)},
139 {0, tailof(2), headof(2)},
140
141 {3, tailof(1), headof(1)},
142 {0, tailof(1), headof(1)}
143};
144
145// Border nodes are on the very edge of the network.
146// Ripples fired here don't look very impressive.
147int numberOfBorderNodes = 10;
148int borderNodes[] = {0, 1, 2, 3, 6, 10, 13, 19, 21, 24};
149
150// Cube nodes link three equiangular segments
151// Firing ripples that always turn in one direction will draw a cube
152int numberOfCubeNodes = 8;
153int cubeNodes[] = {7, 8, 9, 11, 12, 17, 18};
154
155// Firing ripples that always turn in one direction will draw a starburst
156int starburstNode = 15;
157
158#endif