need help to transfer variable (syntax problem)

h (again!)
i am working on LED DISPLAY and i have a problem.

here are some variables

//these are patterns for shift out in led display#define A {B00111100,B01000010,B01000010,B01000010,B01111110,B01000010,B01000010,B01000010}
#define B {B01111100,B01000010,B01000010,B01111100,B01000010,B01000010,B01000010,B01111100}
#define C {B00111110,B01000000,B01000000,B01000000,B01000000,B01000000,B01000000,B00111110}
#define D {B01111100,B01000010,B01000010,B01000010,B01000010,B01000010,B01000010,B01111100}
#define E {B01111110,B01000000,B01000000,B01111100,B01000000,B01000000,B01000000,B01111110}

//these are the variables that program will use for shifting out. like this byte patterns[numPatterns][10]={pat1,pat2,pat2,pat4,pat5}; )

#define pat1
#define pat2
#define pat3
#define pat4
#define pat5

//these are the variables that are coming via serial communication ( for example in define serial_income1 i will store the letter A,on define serial_income2 i will store the letter C)

#define serial_income1
#define serial_income2
#define serial_income3
#define serial_income4
#define serial_income5

how can i store in pat1,pat2,pat3,pat4,pat4,pat5 the binaries of patterns A,B,C,D, accordingly to the data that serial_income have?

in other words
i want a program that when i send a text via Serial (for example ABACD) the equivalent pattern to be saved in pat1,pat2,pat3,pat4,pat5)

still comfused?
i want to make this program so i can send via serial communication the pattterns i want
code:
http://www.instructables.com/files/orig/FWE/03YD/G56ZZXYW/FWE03YDG56ZZXYW.txt[/size]

#define A     {B00111100,B01000010,B01000010,B01000010,B01111110,B01000010,B01000010,B01000010[glow]}[/glow]

byte pat1 []= A;

that's all? will that work?

THANKS!!!!!!!

:smiley: :smiley: :smiley: :smiley: :smiley: :smiley:

will that work?

No, not necessarily, but it'll be easier to compile than the stuff you posted.

#define A     {B00111100,B01000010,B01000010,B01000010,B01111110,B01000010,B01000010,B01000010}

byte pat1 []= A;

well...this is not solution becouse i cant change pat1 variable.

i want to be able to change the CHARS i want (using serial communication)

for example on this code
http://www.instructables.com/files/orig/FWE/03YD/G56ZZXYW/FWE03YDG56ZZXYW.txt

in the line

byte patterns[numPatterns][10]={space,M,A,D,E,space,B,Y,space,V,A,D,I,M,space}

i want to be able to change them with the content of mine variables (for example pat1,pat2,pat3...)

any help?

All you need is an array of pointers to array, isn't it?
It isn't very clear (to me) what it is you want to do.

I think you're saying the "#define" bit patterns represent letters (instead of "#define A {yadda}", I think I'd go for "#define _A {yadda}"), and so you want to have a constant 2D array of these in alphabetical order.
Then, your message array just has to be a set of indices into the 2D array.

I am trying to anderstand, but can you make a simple example?

OK, (and I'm still not clear exactly what you want) looking at the Instructables you linked to, the message in "patterns" was fixed, and should read " MADE BY VADIM ".
This meant that only the patterns for the letters in that string needed to be stored.
This program would store the patterns for M,A and D twice, and the pattern for "space" four times. No big deal, because you only need 17 characters total.

Now, I think you're saying that you want to be able to type in any message, and have it appear on your display.
So, that means that you need to store all the patterns for A to Z, lit_a to lit_z and numbers 0..9, plus space.
In total, that's 26 + 26 + 10 + 1 = 63 characters, each of ten bytes.
If you had enough memory, you'd simply store these in a large array of 128 x 10 bytes, and use the ASCII code of the letter you'd typed to access this. All other characters would be empty.
I think you're going to have to save space, so you'll need to do a bit of arithmetic on the incoming ASCII characters to get the correct index into your character generator array.
('A' = 0x41 'Z' = 0x5A, 'a' = 0x61 'z' = 0x7a, '0' = 0x30 '9' = 0x39, space = 0x20)

byte charGen [63][10] = { A, B, C, D, E, F...,
                                                 lit_a, lit_b, lit_c...,
                                                 num_0, num_1, num_3,...
                                                 times};

All i want is to make the program so that i can send the characters via serial communication
or from a variables like this
1_char = "T"
2_char "H"
3_char="O"
4_char="M"
5_char="A"
6_char="S"

//these are the variables that program will use for shifting out. like this byte patterns[numPatterns][10]={pat1,pat2,pat2,pat4,pat5}; )

#define pat1
#define pat2
#define pat3
#define pat4
#define pat5

In that case, you need to learn the difference between macro and variable declarations.

Nasty pseudo code.

int makeCharGenIndex (byte nextChar)
{
  byte offset = 0;
  if (nextChar >= 'A' && nextChar <= 'Z') {
    return nextChar - 'A';
  }
  offset += 'Z' - 'A';
  if (nextChar >= 'a' && nextChar <= 'z') {
    return nextChar - 'a' + offset;
  }
  offset += 'z' - 'a';
  if (nextChar >= '0' && nextChar <= '9') {
    return nextChar - '9' + offset;
  }
  offset += '9' - '0';
  if (nextChar == '*') {
    return offset;
  }
  // I think I've forgotten 'space'
  return -1;
}