Pages: [1]   Go Down
Author Topic: LED Matrix - animation pattern  (Read 2572 times)
0 Members and 1 Guest are viewing this topic.
Germany
Offline Offline
Full Member
***
Karma: 1
Posts: 130
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

in my little LED Coffee-Table project, I´d like to integrate some cool animations.
The very most threads show a specified matrix for a special case. (Clock, running text, equalizer, ect.)

So I´m looking for some animaton patterns, to run them one after another. The library or LED type, should be unimportant.
What do I expect?
Some waves, circles or rectangles running over the matrix. Calculate some spectrals and produce some nice outputs.

For example a very simple ambiente-light which is fading very slow:
Code:
LEDPixels LP;
int MyDisplay[100];
byte r,g,b;
int moveSpeed = 300;
void Ambiente()
{
  //Fade through random colors
  byte tr,tg,tb;
  tr = random(0,31);
  tg = random(0,31);
  tb = random(0,31);
  FadeLED(20, moveSpeed, r,g,b, tr,tg,tb);
  r = tr;
  g = tg;
  b = tb;
}

void FadeLED(int steps, int fadedelay, byte red1, byte green1, byte blue1, byte red2, byte green2, byte blue2)
{
  for (int  fadindex = 0;  fadindex < steps+1;  fadindex++)
  {
    LP.setRange(0,99,LP.color((red1 * (steps -  fadindex) + red2 *  fadindex)/steps,
    (green1 * (steps -  fadindex) + green2 *  fadindex)/steps,
    (blue1 * (steps -  fadindex) + blue2 *  fadindex)/steps)); 
    LP.show();
    delay(fadedelay);
  }
}

Or a matrix, which seems to float like in the movie:
Code:
int MatrixColor = LP.color(0,31,0); //Green
void setup() {
  LP.initialize(20, &MyDisplay[0],100, 8, 7 );  //Frequence, address of display, no of leds,clock (green), data (yellow)
  LP.gridWidth=10;
  LP.gridHeight=10;
}
void TheMatrix()

  ShiftMatrixLines();
  DrawMatrixHeader();
  LP.show();
  delay(100);
}

//Create new points in the first row. Probability to set it coloured: 1/3rd
void DrawMatrixHeader()
{
  for(int i = 0; i < LP.gridWidth;i++)
  {
    MyDisplay[LP.Translate(i,9)] = random(2,4)%2 == 0 ? LP.color(0,0,0) : MatrixColor; //Chance of 1/3rd
  }
}

//Shift Matrixrow down
void ShiftMatrixLines()
{
  for(byte i = 0; i < LP.gridHeight;i++)
  {
    for(byte j = 0; j < LP.gridWidth;j++)
    {
      MyDisplay[LP.Translate(i,j)] = MyDisplay[LP.Translate(i,j+1)];
    }
  }
}

In this cases I´m using a Bliptronics 8mm LED chain. So the "MyDisplay" Array represents the Matrix like this:
8 3 2
7 4 1
6 5 0
The function "LP.Translate" from the <LEDPixels.h> Library calculates X/Y-Coordinates to the chain.

I hope that we can collect some animations here, which easyly can be translated to any other matrix.
Logged

Germany
Offline Offline
Full Member
***
Karma: 1
Posts: 130
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To show what I mean and to introduce my table:



EDIT: However a YT video is embedded correctly  smiley-roll-sweat
« Last Edit: September 07, 2011, 03:26:38 pm by Trib » Logged

Germany
Offline Offline
Full Member
***
Karma: 1
Posts: 130
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And a little Snake game:



Poorly the LED´s are to bright for my camera. In reality it looks more clear ans smooth.
The speed can be controlled by a poti or raised by every "apple".
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Very nice!
Just opening this back up as you were kind enough to reply on another thread and I think this is a great idea.
What about one, or several, bouncing balls that collide with the edges and maybe even each other.
I thought I'd start you off with something really easy.....  smiley-twist
Logged

Pages: [1]   Go Up
Jump to: