Binary numbers saved in char arrays.

Hi!

I am trying to figure out how binary numbers are stored in a char array. With the code:

const unsigned char PROGMEM PatternTable[] = {B0010,B1111,B1000,B0000, 10,};

How are these numbers gonna be stored in the char array PatternTable[]? Are they stored in 5 elements as binary numbers or stored in 5 elements as regular numbers? And what about the 10 in decimal?

Thanks

The line you posted has several errors, but all numbers stored in memory are binary.
You can interpret those values any way you like.

Thanks, that's helpful information. Actually it works like that, there is no error in the code.
What I did is I built a led cube 4x4x4 controlled by the arduino uno. The format of "B1111, B1001" etc. is what decides which LED is gonna light up, but to get more memory for patterns it is saved in flash memory.

The syntax you are using produces a warning and I see no benefit in dropping the usual '='.

warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]

const unsigned char PROGMEM PatternTable[] {B0010,B1111,B1000,B0000, 10,};
const unsigned char PROGMEM PatternTable[] = {B0010,B1111,B1000,B0000, 10,};

In your first post you are talking about 5 arrays,
there is only one of them with 5 elements, which are unsigned characters.

Of course, my bad! It was supposed to be an equals sign and I of course meant elements. Thanks!

Keep in mind that a char is a signed 8 bit number, whereas a byte is an unsigned 8 bit number.

...R