sounds like you need a way to turn on/off a light corresponding to a specific bit in a bit sequence 1<<N shifts a 1 N bits to the left, equal to 2 to the Nth power.
if you have a 5 byte array, you could set the Nth bit by using the integer division and mod operator that returns the remainder of a divition
arr [N /8] |= 1 << (N %8);
and conversely to clear a bit
arr [s /8] &= ~(1 << (s %8));