Skip to content

Commit 86f10f1

Browse files
committed
Revert "move defines to ino"
This reverts commit 9b50b43.
1 parent 9b50b43 commit 86f10f1

File tree

4 files changed

+49
-53
lines changed

4 files changed

+49
-53
lines changed

GemmaM0_Band_Jacket/DiscoBandCamp/DiscoBandCamp.ino

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -44,55 +44,6 @@
4444
#include "buttons.h"
4545
extern XYMap myXYMap;
4646

47-
CRGB leds[ NUM_LEDS ];
48-
49-
uint16_t XY(uint16_t x, uint16_t y, uint16_t width, uint16_t height)
50-
{
51-
(void)width;
52-
(void)height;
53-
// any out of bounds address maps to the first hidden pixel
54-
if( (x >= kMatrixWidth) || (y >= kMatrixHeight) ) {
55-
return (LAST_VISIBLE_LED + 1);
56-
}
57-
58-
// On the visual left of DiscoBandCamp, wearers right
59-
// +------------------------------------------
60-
// | 10 9 8 7 6 5 4 3 2 1 0
61-
// | . 20 19 18 17 16 15 14 13 12 11
62-
// | . . 29 28 27 26 25 24 23 22 21
63-
// | . . . 37 36 35 34 33 32 31 30
64-
// | . . . . 44 43 42 41 40 39 38
65-
// | . . . . . 50 49 48 47 46 45
66-
// | . . . . . . 55 54 53 52 51
67-
// | . . . . . . . 59 58 57 56
68-
69-
//this is how DiscoBandCamp works
70-
const uint8_t JacketTable[] = {
71-
10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 145,
72-
153,60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
73-
120,11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 146,
74-
154,80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 182,
75-
121,127,21, 22, 23, 24, 25, 26, 27, 28, 29, 147,
76-
155,89, 88, 87, 86, 85, 84, 83, 82, 81, 176,183,
77-
122,128,133,30, 31, 32, 33, 34, 35, 36, 37, 148,
78-
156,97, 96, 95, 94, 93, 92, 91, 90, 171,177,184,
79-
123,129,134,135,38, 39, 40, 41, 42, 43, 44, 149,
80-
157,104,103,102,101,100,99, 98, 167,172,178,185,
81-
124,130,134,136,139,45, 46, 47, 48, 49, 50, 150,
82-
158,110,109,108,107,106,105,164,168,173,179,186,
83-
125,131,134,137,140,142,51, 52, 53, 54, 55, 151,
84-
159,115,114,113,112,111,162,165,169,174,180,187,
85-
126,132,134,138,141,143,144,56, 57, 58, 59, 152,
86-
160,119,118,117,116,161,163,166,170,175,181,188,
87-
};
88-
89-
uint8_t i = (y * kMatrixWidth) + x;
90-
uint8_t j = JacketTable[i];
91-
return j;
92-
}
93-
// Instantiate an XYMap object
94-
XYMap myXYMap = XYMap::constructWithUserFunction(kMatrixWidth, kMatrixHeight, XY);
95-
9647
// list of Functions:
9748
functionList effectList[] = {SolidRed, //all pixels solid red
9849
swirly, //glittery swirly patterns

GemmaM0_Band_Jacket/DiscoBandCamp/XYmap.h

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,51 @@ extern CRGB leds[ NUM_LEDS ];
4141
// This code, plus the supporting 80-byte table is much smaller
4242
// and much faster than trying to calculate the pixel ID with code.
4343
#define LAST_VISIBLE_LED 119
44-
uint16_t XY(uint16_t x, uint16_t y, uint16_t width, uint16_t height);
45-
extern XYMap myXYMap;
44+
uint16_t XY(uint16_t x, uint16_t y, uint16_t width, uint16_t height)
45+
{
46+
(void)width;
47+
(void)height;
48+
// any out of bounds address maps to the first hidden pixel
49+
if( (x >= kMatrixWidth) || (y >= kMatrixHeight) ) {
50+
return (LAST_VISIBLE_LED + 1);
51+
}
52+
53+
// On the visual left of DiscoBandCamp, wearers right
54+
// +------------------------------------------
55+
// | 10 9 8 7 6 5 4 3 2 1 0
56+
// | . 20 19 18 17 16 15 14 13 12 11
57+
// | . . 29 28 27 26 25 24 23 22 21
58+
// | . . . 37 36 35 34 33 32 31 30
59+
// | . . . . 44 43 42 41 40 39 38
60+
// | . . . . . 50 49 48 47 46 45
61+
// | . . . . . . 55 54 53 52 51
62+
// | . . . . . . . 59 58 57 56
63+
64+
//this is how DiscoBandCamp works
65+
const uint8_t JacketTable[] = {
66+
10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 145,
67+
153,60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
68+
120,11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 146,
69+
154,80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 182,
70+
121,127,21, 22, 23, 24, 25, 26, 27, 28, 29, 147,
71+
155,89, 88, 87, 86, 85, 84, 83, 82, 81, 176,183,
72+
122,128,133,30, 31, 32, 33, 34, 35, 36, 37, 148,
73+
156,97, 96, 95, 94, 93, 92, 91, 90, 171,177,184,
74+
123,129,134,135,38, 39, 40, 41, 42, 43, 44, 149,
75+
157,104,103,102,101,100,99, 98, 167,172,178,185,
76+
124,130,134,136,139,45, 46, 47, 48, 49, 50, 150,
77+
158,110,109,108,107,106,105,164,168,173,179,186,
78+
125,131,134,137,140,142,51, 52, 53, 54, 55, 151,
79+
159,115,114,113,112,111,162,165,169,174,180,187,
80+
126,132,134,138,141,143,144,56, 57, 58, 59, 152,
81+
160,119,118,117,116,161,163,166,170,175,181,188,
82+
};
83+
84+
uint8_t i = (y * kMatrixWidth) + x;
85+
uint8_t j = JacketTable[i];
86+
return j;
87+
}
4688
#endif
89+
90+
// Instantiate an XYMap object
91+
XYMap myXYMap = XYMap::constructWithUserFunction(kMatrixWidth, kMatrixHeight, XY);

GemmaM0_Band_Jacket/DiscoBandCamp/effects.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Selection of effects from the FastLED library & Macetech RGB Shades
66
#include "XYmap.h"
7-
7+
extern XYMap myXYMap;
88
// Triple Sine Waves
99
void threeSine() {
1010

GemmaM0_Band_Jacket/DiscoBandCamp/utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// SPDX-License-Identifier: MIT
44
#include "XYmap.h"
5-
5+
extern XYMap myXYMap;
66
// Assorted useful functions and variables
77
// Global variables
88
boolean effectInit = false; // indicates if a pattern has been recently switched

0 commit comments

Comments
 (0)