Shifting Columns


the segments are wired oddly making software a bit wonky for the 2 rows. The segments are ….
0123
7654

#include <LedControl.h>

int p; byte x, y, s; byte z[65] = {};

LedControl lc = LedControl(11, 13, 7, 8); // DIN,CLK,CS,SEGS

void setup() {
  int devices = lc.getDeviceCount(); 
    for (int address = 0; address < devices; address++) 
        {lc.shutdown(address, false); 
        lc.setIntensity(address, 0); 
        lc.clearDisplay(address);} 
    for (s = 0; s < 8; s++) {lc.clearDisplay(s);} 
    for (p=0;p<65;p++) {z[p]=random(0,255);}
}

void loop()  {x = 0; s = 0; p = 0;
  while (s < 4) {
    z[p] = z[p + 1];
    lc.setColumn(s, 7 - x, z[p]);
    z[p + 32] = z[p + 33];
    lc.setColumn(7 - s, x, z[p + 32]);
    x++;p++; 
    if (x == 8) {x = 0; s++;}}
    
  z[32] = random(0, 255); z[64] = random(0, 255); 
  lc.setColumn(0, 7, z[32]); 
  lc.setColumn(7, 0, z[64]);
}
Final version eliminated flicker….. much better