   setup_timer1_ovf();
 }
 
-void runaround()
-{ 
-  static byte n = 250;
-  static byte r = 0;
-  static byte g = MAX_BRIGHTNESS;
-  static byte b = 0;
-  
-  r = random(MAX_BRIGHTNESS);
-  g = random(MAX_BRIGHTNESS);
-  b = random(MAX_BRIGHTNESS);
-  
-  for(byte y=0; y < HEIGHT; ++y)
-  {
-    for(byte x=0; x < WIDTH; ++x)
-    {
-      memset((void*)brightness, 0, sizeof(brightness));      
-      set_led_rgb(x, y, r, g, b);
-      delay(n);
-    }
-    
-    ++y;
-    
-    for(int x=WIDTH-1; x != -1; --x)
-    {
-      memset((void*)brightness, 0, sizeof(brightness));
-      set_led_rgb(x, y, r, g, b);
-      delay(n);
-    }
-  }
-  
-  for(byte y=HEIGHT-2; y != 0; --y)
-  {
-    memset((void*)brightness, 0, sizeof(brightness));
-    set_led_rgb(0, y, r, g, b);
-    delay(n);
-  }
-  
-  r = random(MAX_BRIGHTNESS);
-  g = random(MAX_BRIGHTNESS);
-  b = random(MAX_BRIGHTNESS);
-}
-
 void random_leds(void) {
   set_led_hue(
       (byte)(random(WIDTH))

      Serial.println(" OK ");
    }
  
    if(sbuf[0] == 'b' && index == 5)
    {
      String s("");

  ptrBrightnessUSING = ptrBrightness;
}

volatile byte RUNMODE = 'C';

void loop(void) 
{
  checkSerial();
  switch(RUNMODE)
  {
    case 'A': runGrid(); break;
    case 'B': for(unsigned int i=0; i < 100; ++i) { random_leds(); copyBuffer(); delayMicroseconds(10); } break;
    case 'C': color_wave(18); copyBuffer(); delayMicroseconds(25); break;
    case 'D': rainbow(); delayMicroseconds(25); break;
    case 'E': ShowGoomba(); delayMicroseconds(25); break;
  }
}

inline void set_led_red(byte x, byte y, byte red)     { *(ptrBrightness + RED(x, y)) = red; }
