Just wanted to say that I have finally sorted out my GitHub  http://github.com/AaronLiddiment and

Just wanted to say that I have finally sorted out my GitHub http://github.com/AaronLiddiment and made separate repositories for my LEDMatrix, LEDText & LEDSprite classes and added full instruction Wiki’s for each :slight_smile:
I have also added my LEDSync class for anyone wanting to sync multiple Teensy’s together, though instructions are thin :wink:
I have also added a Custom RC effect to the Text class that allows you to set custom return codes from the Update function so that events can be triggered when certain parts of the message are reached.
Finally, I am thinking about extending the templated Matrix class to add full support for the Z dimension and thereby usable with the Text & Sprite classes as well as independently. I would therefore like anyone who has made a 3D matrix to let me know in what order they have wired it up as I would like it to be easily changed for different schemes, much like I have done with the 2D.

Great contributions! Thank you so much!

Awesome, I’m adding that to my pile o’ links.

Great work @Aaron_Liddiment ​.

Hi Aaron, are you looking for something like a cube for that z dimension aspect ?
If so, here’s my short function that translates the x-y-z to my actual 0-511 LED addressing on my 8X8X8 cube.
I would certainly give your libraries a testing platform if you need it !
uint16_t XYZ( uint8_t x, uint8_t y, uint8_t z)
{
uint16_t i;

if(z & 1) i = kCubeSize * ((x * kCubeSize) + z) +7-y; // Check for odd numbered vertical layers
else i = kCubeSize * ((x * kCubeSize) + z) + y; // to take care of cube’s zig-zag wiring

if ((i >= 0) && (i <= 512))
return i;
else
return 0;
}

So if I have decoded it correctly, your cube is wired from bottom left front corner in a vertical zig zag order to the bottom left back corner, then comes back to the second column (x=1) on the front and repeats.

Hi @Aaron_Liddiment ,
I think you got it but let me give you a more detailed view…
Each vertical slice of 8X8 is driven by a pin of the OCTOWS2811 adaptor.

The 1st vertical slice is composed of LED-0 through LED-63 and is all X0

The 2nd vertical slice is composed of LED-64 through LED-127 and is all X1

The 3rd vertical slice is composed of LED-128 through LED-191 and is all X2

etc… etc…
Each vertical slice of 8X8 is wired identically.
Starting from the bottom row and zig-zag to the top row like this:
Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7
63 62 61 60 59 58 57 56 Z7
48 49 50 51 52 53 54 55 Z6
47 46 45 44 43 42 41 40 Z5
32 33 34 35 36 37 38 39 Z4
31 30 29 28 27 26 25 24 Z3
16 17 18 19 20 21 22 23 Z2
15 14 13 12 11 10 09 08 Z1
00 01 02 03 04 05 06 07 Z0

Thanks, that’s how I pictured it. Your code is efficient.
I am looking at forcing the X/Y to be the first face using any of four wiring styles, then allowing the Z slices to either be unifrom (like yours) or alternate.
Besides allowing standard X/Y/Z access I then want to implement a face & slice setting that then allows 2D access. This will make it work with my LEDText & LEDSprite classes.
It may take a while :wink:

Thanks @Aaron_Liddiment !
No rush… just knock when you would like me to take your 3D upgraded library out for a spin.
One more clarification about cube’s XYZ position mapping to physical LED addresses. In all cases I am aware of, the Z axis is fixed and cannot change (IE: cubes can’t be rotated fully like a Rubik’s cube) because the Z=0 slice is normally fixed to a base of some sort.
For my cube, you can walk around it 360° and it gives you a very valid view. That is not the case for cubes like the L3D cubes that have only about 120° viewing angle.
So for my cube, X=0,Y=0 is not necessarily the front left LED from all point of views !!

Yes, true, I hope to make the 3D support as flexible as the 2D for flipping wiring methods & origins. I want to add a face option that will allow you to select which side has 0,0,0 on it. The difficulty is to do this in a templated class that only adds the correct code at compile time to be as efficient as possible.

is there a way to extend the length of the effects other then using a delay in the main sketch? I’m trying to add brightness and speed control but keep getting issues and would rather slow down the whole animation of the matrix.

I presume you are talking about LEDText, if so then yes, you can use EFFECT_FRAME_RATE “\xHH” where ‘HH’ is a hexadecimal number. So for example if you used 04, the animation would only scroll with every 4th call to Update.

Actually talking about just matrix. I would like to increase the length and so slow down each effects I.e mirror triangle. I’m currently using a delay functions at the end of the code controlled by a pot. It works well for the length but flashes when I try to control the brightness and speed at the same time. The glitch is caused by my own horrible coding but could get rid of the speed control altogether if I could control the speed/length another way .

Still not quite sure of what you are after. There is no way really to slow down a mirror operation as it would not be a mirror if it was done in stages. If you post your code to pastebin I could take a look at your problem for you.

Here’s my final code that allowed me to slow down the speed/length of your program. Please excuse my lack of professional coding I’ve never taken a programming class or a higher level math class for that matter. So along with my extremely dyslexia coding is extremely difficult for me. With that being disclosed here is my code:

#include <FastLED.h>
#include <LEDMatrix.h>

const int analogInPin = 14; // potentiometer
const int analogOutPin = 9; // LED not used currently
int sensorValue = 0; // value read from the pot
int outputValue = 0; // value output to the PWM (analog out)

#define LED_PIN 2 // Data Pin
#define COLOR_ORDER GRB
#define CHIPSET WS2812B
#define MATRIX_WIDTH 21
#define MATRIX_HEIGHT 15
#define MATRIX_TYPE HORIZONTAL_MATRIX s

cLEDMatrix<MATRIX_WIDTH, MATRIX_HEIGHT, MATRIX_TYPE> leds;
uint8_t hue;
int16_t counter;

void setup(){
Serial.begin(9600);

FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds[0], leds.Size());
FastLED.setBrightness(25);
FastLED.clear(true);
delay(500);

// Would like to add BMP images here //

FastLED.showColor(CRGB::Red);
delay(1000);
// than display the same image in red //

FastLED.showColor(CRGB::Lime);
delay(1000);
// than display the same image in green //

FastLED.showColor(CRGB::Blue);
delay(1000);

// than display the same image in blue //

// Would also like to add sliding text from left to right “Larry” //

FastLED.clear(true);

hue = 0;
counter = 0;
}

void loop(){

sensorValue = analogRead(analogInPin);
outputValue = map(sensorValue, 0, 1023, 0, 100); // 100 seems to work best anything more then 230’s will cause lights to glitch on movement of pot
// change the analog out value:
analogWrite(analogOutPin, outputValue);

Serial.print(“sensor = " );
Serial.print(sensorValue);
Serial.print(”\t output = ");
Serial.println(outputValue);

int16_t sx, sy, x, y;
uint8_t h;

FastLED.clear();

h = hue;
if (counter < 1125)
{
// ** Fill LED’s with diagonal stripes
for (x=0; x<(leds.Width()+leds.Height()); ++x)
{
leds.DrawLine(x - leds.Height(), leds.Height() - 1, x, 0, CHSV(h, 255, 255));
h+=16;
}
}
else
{
// ** Fill LED’s with horizontal stripes
for (y=0; y<leds.Height(); ++y)
{
leds.DrawLine(0, y, leds.Width() - 1, y, CHSV(h, 255, 255));
h+=16;
}
}
hue+=4;

if (counter < 125)
;
else if (counter < 375)
leds.HorizontalMirror();
else if (counter < 625)
leds.VerticalMirror();
else if (counter < 875)
leds.QuadrantMirror();
else if (counter < 1125)
leds.QuadrantRotateMirror();
else if (counter < 1250)
;
else if (counter < 1500)
leds.TriangleTopMirror();
else if (counter < 1750)
leds.TriangleBottomMirror();
else if (counter < 2000)
leds.QuadrantTopTriangleMirror();
else if (counter < 2250)
leds.QuadrantBottomTriangleMirror();

counter++;
if (counter >= 2250)
counter = 0;
delay(outputValue); // Speed control via pot
FastLED.show();
}

BTW thank you for your time, work and code.
I was also curious what would need to be done to get this running on something cheaper then the teensy. I have had 4 unit’s completely fail on me for no reason of my own. https://forum.pjrc.com/threads/31685-Anyone-else-having-issues-with-micro-usb-jacks-easily-coming-off

And it appears the staff really want’s to place blame on anything but a shotty flow job and the hard connection points on the bottom are a joke and ripped up with even the lowest heat. The cheaper LC model has

I tried to get the code running on a 328, 32u4 and a teeny lc which i thought it was going to work at one time it was not operational. I believe i was able to get it to compile once but it did not light up anything.

Strange, I have around 9 Teensy 3’s and only destroyed one, my fault! I have not had issues with the micro usb, cables in/out all the time. One thing I do is to cut the 5v link so always have to use external power.
The 328 & 32u4 are a bit tight on the ram side, but the Teensy LC should have enough for a lot of the included examples to build & run.
DId you modify the lines near the top of the examples to match your setup correctly?
#define LED_PIN 2
#define COLOR_ORDER GRB
#define CHIPSET WS2812B
#define MATRIX_WIDTH 80
#define MATRIX_HEIGHT 10
#define MATRIX_TYPE HORIZONTAL_MATRIX

Yes, I used the same code used for the 3.1 for the LC. If i can remember correctly i could get it to compile but did not run. (no lights) I will try it here in about 20 mins after i calm down. I use lost another teensy 3.1 that the jack was previous ripped off and I was attempting to use the below super tiny d- & d+ connections when they of course ripped off.

I really want to move to a MCU i can build my own boards for. The teensy seems like it might be a little more difficult with it’s extra parts and coding.