void setNumber(byte DIGITS[]){ for (int i = 0; i < 8; i++) { lc.setRow(0,i,DIGITS[i]); }}You passed the wrong thing to the function. You sent it a number but you told the function that this number was actually the start of an array that did not exist. Yes it had the same name as your array of bit patterns but a function has it's own scope, that is the values passed to it are valid only within the function you passed it to. Therefore when you passed the function a number and told the function that the number you passed represented an array, it took you at your word. Because this corresponded to no such number, it still assumed it did and so the upshot was when you used it it essentially dragged junk numbers from stuff that happened to be in that memory location.

By telling the function that the number passed to it represented an index in your array of bit patterns corresponding to how we see numbers represented, which is what we intended, it got the correct bit patterns.You also note that in using:-