Why does Hex not read out in an array for LED "clock"?

So what I guess I'm asking is how can you walk through the byte in the data array?

Have a read of this:-
http://www.thebox.myzen.co.uk/Tutorial/Arrays.html

Hey guys, thanks so much for your help. I've got one more question, but mostly I wanted to share with you my end result for you to maybe point out any issues but also to share with anyone now or in the future that may be looking for similar code. One last question. Any materials that I could read to understand more of the masking method? I'm going to be stepping into ARM here soon and I know libraries are vastly different and want to understand the raw code of masking.
Edit: What's the easiest way to determine size of an array. I'd rather not have a pinCount and arrayCount but Sizeof doesn't seem to work on arrays. I know I could probably put together some for loops to do the counting for me but I was hoping there'd be some function that could do it for me.

int pins[] = {9,10,11,12};	// an array of pin numbers
int pinCount = 4;
int data[] = {0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF};// array of data
int arrayCount = 16;
int timer = 1000; //1 sec delay

void setup() {
  for (int thisPin = 0; thisPin < pinCount; thisPin++)  { //Initialize pins[] as outputs
    pinMode(pins[thisPin], OUTPUT);      
  }
}

void loop()
{
  for (int a = 0; a < arrayCount; a++)  //Cycle through the data[]
   {
     for (int b = 0; b < pinCount; b++)  //Cycle through bits in each data[] entry
     {
       digitalWrite(pins[b], bitRead(data[a],b)); //Write to the corresponding pins[] the corresponding data in data[]
     }
     delay(timer);
   }
}

Size of array as in number of bytes it occupies or number of elements ?

Drewski:
What's the easiest way to determine size of an array. I'd rather not have a pinCount and arrayCount but Sizeof doesn't seem to work on arrays. I know I could probably put together some for loops to do the counting for me but I was hoping there'd be some function that could do it for me.

Again - right in my last post!!!

#define ENTRIES(ARRAY)  (sizeof(ARRAY) / sizeof(ARRAY[0]))

lloyddean:

Drewski:
What's the easiest way to determine size of an array. I'd rather not have a pinCount and arrayCount but Sizeof doesn't seem to work on arrays. I know I could probably put together some for loops to do the counting for me but I was hoping there'd be some function that could do it for me.

Again - right in my last post!!!

#define ENTRIES(ARRAY)  (sizeof(ARRAY) / sizeof(ARRAY[0]))

Sorry for that part. I glazed over that because I don't really understand that. Would you mind just stepping through it? What I do understand is your defining the a function "Entries" and a parameter "array". I just don't understand what exactly is going on after, or I should clarify in that I'm not following. I see your using the sizeof function with that array parameter and dividing by the first element of the array. I guess I'm missing the logic here as to why your dividing by the first element in the array.
Example. Entries(pins[]) = (sizeof(pins[])/sizeof(pins[0])) = 4/9???

UKHeliBob:
Size of array as in number of bytes it occupies or number of elements ?

Size of array as in number of elements.

Not a function but a MACRO. If gets expanded in place where ever it is used.

'sizeof()' is a compile time function that returns the amount of memory, in bytes, if its parameter.

'sizeof(pins)' returns the number of bytes the array 'pins' occupies, which in this case is the 4 entries in the array times the size of an 'int' which is 2 bytes for a total of 8 bytes. This is divided by the number of bytes an element of the array occupies, in this case element 0 (an array must have at least 1 element so we chose that element) which is an 'int', or 2 bytes. 8 (bytes) divided by 2 (bytes) equals 4 entries in the array. Again this is a calculated at compile time the the compiler and inserted as constants in the code.

If you find your eyes glazing over it's probably the time to ask a question.