Multi-Dimensional Arrays, Retreving data.

KISS, man, KISS. Keep It Stupidly Simple.

I would setup an unsigned int array of length 16. That will give you 16 bits wide and 16 rows tall.

On button press:

  1. turn off the old bit
  2. update posX and posY
  3. turn on bit at new location
  4. send array to shift registers