I know ive been asking a lot the past few posts.

I know ive been asking a lot the past few posts.
I feel as though im getting close. There is just a lack of knowledge on my own end to accurately trouble shoot these issues

Using the RGB_shades code and the Matrix test code FASTLed Provides ive come up with this and did some testing.

#include <FastLED.h>
#include <EEPROM.h>

#define LED_PIN 9

#define COLOR_ORDER GRB
#define CHIPSET WS2812B

#define BRIGHTNESS 64

// Params for width and height
const uint8_t kMatrixWidth = 26;
const uint8_t kMatrixHeight = 14;
const bool kMatrixSerpentineLayout = true;

// Pixel layout
//
// 0 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
// +-----------------
// 0 | 0 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
// 1 | 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
// 2 | 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
// 3 | 78 79 80 81 82 83 84 85 86 87 . 88 . 89 . 90 . 91 92 93 94 95 96 97 98 99
// 4 | 100 101 102 103 104 105 106 107 108 109 . . . 110 . . . 111 112 113 114 115 116 117 118 119
// 5 | 120 123 124 125 126 127 128 129 130 131 132 . 133 . 134 . 135 136 137 138 139 140 141 142 143 144
// 6 | 145 146 147 148 149 150 151 152 153 154 . . . 155 . . . 156 157 158 159 160 161 162 163 164
// 7 | 165 166 167 168 169 170 171 172 173 174 . . . 175 . . . 176 177 178 179 180 181 182 183 184
// 8 | 185 186 187 188 189 190 191 192 193 194 . . . 195 . . . 196 197 198 199 200 201 202 203 204
// 9 | 205 206 207 208 209 210 211 212 213 214 . 215 . 216 . 217 . 218 219 220 221 222 223 224 225 226
//10 | 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
//11 | 253 254 255 256 257 258 259 260 261 . . 262 263 264 265 266 . . 267 268 269 270 271 272 273 274
//12 | 275 276 277 278 279 280 281 282 283 284 . . . . . . . 285 286 287 288 289 290 291 292 293
//13 | 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 333 314 315 316 317 318 319

#define NUM_LEDS (kMatrixWidth * kMatrixHeight)
CRGB leds[ NUM_LEDS ];

// This function will return the right ‘led index number’ for
// a given set of X and Y coordinates on your RGB Shades.
// This code, plus the supporting 80-byte table is much smaller
// and much faster than trying to calculate the pixel ID with code.
#define LAST_VISIBLE_LED 320
uint8_t XY( uint8_t x, uint8_t y)
{
// any out of bounds address maps to the first hidden pixel
if( (x >= kMatrixWidth) || (y >= kMatrixHeight) ) {
return (LAST_VISIBLE_LED + 1);
}

const uint8_t ShadesTable[] = {
0, 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, 320, 88, 321, 89, 322, 90,323,91,92,93, 94, 95, 96, 97, 98, 99,
100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 324, 325, 326, 110, 327, 328, 329, 111, 112, 113, 114, 115, 116, 117, 118, 119,
120, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 330, 133, 331, 134, 332, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 333, 334, 335, 155, 336, 337, 338, 156, 157, 158, 159, 160, 161, 162, 163, 164,
165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 339, 340, 341, 175, 342, 343, 344, 176, 177, 178, 179, 180, 181, 182, 183, 184,
185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 345, 346, 347, 195, 348, 349, 350, 196, 197, 198, 199, 200, 201, 202, 203, 204,
205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 351, 215, 352, 216, 353, 217, 353, 218, 219, 220, 221, 222, 223, 224, 225, 226,
227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252,
253, 254, 255, 256, 257, 258, 259, 260, 261, 354, 355, 262, 263, 264, 265, 266, 356, 357, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 358, 359, 360, 361, 362, 363, 364, 285, 286, 287, 288, 289, 290, 291, 292, 293,
294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 333, 314, 315, 316, 317, 318, 319
};

uint8_t i = (y * kMatrixWidth) + x;
uint8_t j = ShadesTable[i];
return j;
}
// Demo that USES “XY” follows code below

void loop()
{
uint32_t ms = millis();
int32_t yHueDelta32 = ((int32_t)cos16( ms * (27/1) ) * (350 / kMatrixWidth));
int32_t xHueDelta32 = ((int32_t)cos16( ms * (39/1) ) * (310 / kMatrixHeight));
DrawOneFrame( ms / 65536, yHueDelta32 / 32768, xHueDelta32 / 32768);
if( ms < 5000 ) {
FastLED.setBrightness( scale8( BRIGHTNESS, (ms * 256) / 5000));
} else {
FastLED.setBrightness(BRIGHTNESS);
}
FastLED.show();
}

void DrawOneFrame( byte startHue8, int8_t yHueDelta8, int8_t xHueDelta8)
{
byte lineStartHue = startHue8;
for( byte y = 0; y < kMatrixHeight; y++) {
lineStartHue += yHueDelta8;
byte pixelHue = lineStartHue;
for( byte x = 0; x < kMatrixWidth; x++) {
pixelHue += xHueDelta8;
leds[ XY(x, y)] = CHSV( pixelHue, 255, 255);
}
}
}

void setup() {
FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalSMD5050);
FastLED.setBrightness( BRIGHTNESS );
}

With this code. It will only light up a grid that is the 26x 10 with RANDOM ones turned off.

When I modify the code by changing numbers in my table to anything above 319 it seems I can only control up to LED 64 in the row.

So 0-63 can be shut on and off at will by assigning it any number above 319

I have partial control and Partial display.

Anyone have any ideas?

Shades table needs to be set to uint16_t for sure. Please post code to http://gist.github.com so it can be viewed much easier.

When Changing the UINT8 to 16 the leds will no longer even power on.

That’s odd. When you were using uint8_t the compiler automatically removed anything in that array over 255 and since you technically have 364 LEDs (only 320 visible) that’s why the bottom half of your helmet wasn’t lighting up. Also your last visible LED is 319 not 320.

You’re right. I accidentally copied a version I was toying with.

Either way I can put 320 where let’s say 5 would be and number 5 won’t light up.

All the way until 64 I think it is.

Also random LEDs past 64 aren’t lighting up.

If I just put a non matrix style sketch on it it works.

The Ultimate goal here was to snag one of the effects someone made for the glasses that just basically move a slanted bar accross the matrix

I’m wondering if I could make a marquee? I think that’s what it’s called and just assign make multiple marquees to create the effect that the bar is moving across. Just call out the eye areas as off.

I’d really like to get this RGB shades thing working the potential here is great for my project.

I’ve seen a bunch of people do it but contacting them to pick their brain hasnt been very successful.

Oh crap I just realized I forgot 121, 122, in the order. Wonder if that’s playing a role

Marquee isn’t the term I was looking for.

More of a bit map animation.

Each frame if you will.

I can’t find any example code using fastled matrix though

@Alec_Luce : What chip are you using to run this? When I started using a 16X16 WS2812B matrix, I found that simple FastLED functions like fill_solid would work but the XY matrix sketch would not work at all when I was using an Arduino Uno or Nano. When I switched to a Teensy 3.1 or 3.2, everything worked well. You might be running out of RAM.

Im using an Uno right now. I am getting a message at the end that says Low memory. When I change everything to a 16 rather then an 8 on my uint.

Im game to use a 3.1 or a 3.2. Ill place an order asap. Does the 3.1 or 3.2 Have full support on the fastLED library

I also have a Nano laying around.

@Brian_Lewis

@Ken_White Great call on being out of memory. I’ve been using Teensy and ESP8266 boards for so long I never think about that type of situation.

I saw the warning I just figured it would be fine because its not actually out of memory just low on memory.

Would a low memory situation cause the leds not to light up when changing to the 16? @Brian_Lewis

Also since my leds are 5v I will have to power them with a 5v power supply if I go to a teensy, correct? Since it only does 3.3v

You can power the board with a 5V source. I haven’t had a problem with needing a level shifter for any WS2812 LEDs and the Teensy. You’ll want to wire the power to the LEDs separately though.

@Alec_Luce : If the Uno does not work, the Nano will not either. Both have the same amount of memory. As to FastLED working on a Teensy 3.1 and 3.2, Yes! I use them and many others here have used them with FastLED. When the new Teensy 3.5 and 3.6 are supported on FastLED, I will buy them ASAP!

When using the Teensy 3.1 or 3.2, I use a level shifter (https://www.adafruit.com/products/1787) with my RGB LEDs. However, some here like Brian have said you don’t need them and things work fine for them. Others claim that they are needed. I am in the “they are needed group” even though I have not tried to run pixels without them on the Teensy.

@Brian_Lewis - Thank you. I do a lot of my new code testing on a 24 pixel ring or small matrix using a Uno, Nano or Metro Mini. I learned the hard way about memory limitation and the need for the Teensy 3.1 or 3.2 when I scaled things up or tested very complex sketches.

@Alec_Luce if you stop using arduino and use one of the ESP boards like the WeMos D1 Mini or the NodeMCU, you will save space, money (US$5 free shipping), have more memory and power and have wifi to boot! :slight_smile:

http://www.wemos.cc

Update.

Got the teensy and it solved my issue the UINT16 is now working. Now to figure out how to do my design with the RGB matrix.

I can not believe that a slanted row of traveling leds is proving to be so difficult to make ;(

Do you think a sprite would be a better way to approach this?

@Brian_Lewis When using the exact same code as the ardruino. Im getting very fast erratic led pulses.

Is there something special I should be doing?

NVM figured it out. 5v makes it go crazy stepper is needed.

Glad you got it figured out. I only have 2 projects currently using a teensy and only had to use a level shifter with apa102 LEDs and not ws2812. Looking forward to seeing the final project. Been listening to a lot of Marshmello recently so I know exactly what you’re building.