Braces around Scalar Initializer for type 'byte' ERROR


i'm trying make 2d array, of 8x8 led matrix, original code warants 8x10.
i have code:
code: [select]

#define e  { \
   {0, 1, 1, 1, 1, 1, 1, 0}, \
   {0, 1, 0, 0, 0, 0, 0, 0}, \
   {0, 1, 0, 0, 0, 0, 0, 0}, \
   {0, 1, 1, 1, 1, 1, 1, 0}, \
   {0, 1, 0, 0, 0, 0, 0, 0}, \
   {0, 1, 0, 0, 0, 0, 0, 0}, \
   {0, 1, 0, 0, 0, 0, 0, 0}, \
   {0, 1, 1, 1, 1, 1, 1, 0}  \
}
const int numpatterns = 8;//this number of patterns want display
byte patterns[numpatterns][8]={e,e,e,e,e,e,e,e};// patterns order


except error, appreciated!

e definition 2 dimensional array initialiser.
patterns declared 2 dimensional array, initialise array of 2 dimensional arrays (e), or, in other words 3 dimensional array, , cannot initiate 2 dimensional array 3 dimensional values, hence error.

this solves immediate compile issue:
code: [select]

byte patterns[numpatterns][8][8] ={e,e,e,e,e,e,e,e};// patterns order

but i'm not sure if solves overall problem.


Arduino Forum > Using Arduino > Programming Questions > Braces around Scalar Initializer for type 'byte' ERROR


arduino

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support