Error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'

You can delete that array and use:

  byte digit = val;