       i = (y * kMatrixWidth) + x;
     }
   }
-  
+
   return i;
 }
 

  set_led_rgb(0, 9, 14, 11, 8); set_led_rgb(1, 9, 14, 11, 9); set_led_rgb(2, 9, 14, 11, 9); set_led_rgb(3, 9, 13, 10, 7); set_led_rgb(4, 9, 13, 9, 6);  set_led_rgb(5, 9, 13, 11, 8); set_led_rgb(6, 9, 13, 12, 10);  set_led_rgb(7, 9, 13, 12, 10);  set_led_rgb(8, 9, 13, 12, 10);  set_led_rgb(9, 9, 13, 12, 10);  set_led_rgb(10, 9, 13, 12, 10); set_led_rgb(11, 9, 13, 12, 10); set_led_rgb(12, 9, 13, 12, 10); set_led_rgb(13, 9, 13, 11, 9);  set_led_rgb(14, 9, 13, 9, 6); set_led_rgb(15, 9, 14, 10, 7);  set_led_rgb(16, 9, 14, 11, 9);  set_led_rgb(17, 9, 14, 11, 9);  set_led_rgb(18, 9, 14, 11, 9);  set_led_rgb(19, 9, 14, 11, 9);
}

void setup() {
  // LEDColorCorrection { TypicalSMD5050 =0xFFB0F0, TypicalLEDStrip =0xFFB0F0, Typical8mmPixel =0xFFE08C, TypicalPixelString =0xFFE08C, UncorrectedColor =0xFFFFFF }
  FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(UncorrectedColor);
  FastLED.setBrightness( BRIGHTNESS );

  ShowGoomba();
  FastLED.show();
  FastLED.setBrightness(BRIGHTNESS);
}

  leds[ XY(x, y) ] = CRGB( r, g, b );
}

void RainbowA()
{
    uint32_t ms = millis();
    int32_t yHueDelta32 = ((int32_t)cos16( ms * (27/1) ) * (350 / kMatrixWidth));
    int32_t xHueDelta32 = ((int32_t)cos16( ms * (39/1) ) * (310 / kMatrixHeight));
    DrawOneFrame( ms / 65536, yHueDelta32 / 32768, xHueDelta32 / 32768);
    FastLED.show(); 
}

void DrawOneFrame( byte startHue8, int8_t yHueDelta8, int8_t xHueDelta8)
{
  byte lineStartHue = startHue8;
  for( byte y = 0; y < kMatrixHeight; y++) {
    lineStartHue += yHueDelta8;
    byte pixelHue = lineStartHue;      
    for( byte x = 0; x < kMatrixWidth; x++) {
      pixelHue += xHueDelta8;
      leds[ XY(x, y)]  = CHSV( pixelHue, 255, 255);
    }
  }
}

void Test()
{
  FastLED.clear();
  set_led_rgb(1, 1, 255, 0, 0);
  set_led_rgb(2, 1, 0, 255, 0);
  set_led_rgb(2, 1, 0, 0, 255);  
}

void ShowPotValue()
{
  int val = analogRead(PIN_BRIGHTNESS);
  int numLedsToLight = map(val, 0, 1023, 0, 200);

  FastLED.clear();
    for(int led = 0; led < numLedsToLight; led++) { 
      leds[led] = CRGB::Blue; 
    }
  FastLED.show();
}

void ShowGoomba()
{
  FastLED.clear();
  // Shows a Goomba, see https://raw.githubusercontent.com/cbries/rgbwall/master/Photos,%20Images,%20Videos/Goomba01.jpg
  set_led_rgb(0, 0, 13, 9, 7);  set_led_rgb(1, 0, 13, 5, 0);  set_led_rgb(2, 0, 8, 3, 0); set_led_rgb(3, 0, 5, 2, 1); set_led_rgb(4, 0, 5, 4, 4); set_led_rgb(5, 0, 7, 3, 0); set_led_rgb(6, 0, 10, 4, 0);  set_led_rgb(7, 0, 13, 5, 0);  set_led_rgb(8, 0, 13, 5, 0);  set_led_rgb(9, 0, 13, 5, 0);  set_led_rgb(10, 0, 13, 5, 0); set_led_rgb(11, 0, 13, 5, 0); set_led_rgb(12, 0, 11, 4, 0); set_led_rgb(13, 0, 8, 3, 0);  set_led_rgb(14, 0, 5, 4, 4);  set_led_rgb(15, 0, 5, 3, 1);  set_led_rgb(16, 0, 7, 2, 0);  set_led_rgb(17, 0, 13, 5, 0); set_led_rgb(18, 0, 13, 8, 5); set_led_rgb(19, 0, 14, 11, 10);
  set_led_rgb(0, 1, 13, 5, 0);  set_led_rgb(1, 1, 13, 5, 0);  set_led_rgb(2, 1, 13, 5, 0);  set_led_rgb(3, 1, 13, 6, 2);  set_led_rgb(4, 1, 13, 12, 10);  set_led_rgb(5, 1, 2, 2, 2); set_led_rgb(6, 1, 5, 2, 0); set_led_rgb(7, 1, 13, 5, 0);  set_led_rgb(8, 1, 13, 5, 0);  set_led_rgb(9, 1, 13, 5, 0);  set_led_rgb(10, 1, 13, 5, 0); set_led_rgb(11, 1, 13, 5, 0); set_led_rgb(12, 1, 7, 3, 0);  set_led_rgb(13, 1, 0, 0, 0);  set_led_rgb(14, 1, 13, 12, 9);  set_led_rgb(15, 1, 13, 8, 4); set_led_rgb(16, 1, 13, 5, 0); set_led_rgb(17, 1, 13, 5, 0); set_led_rgb(18, 1, 13, 5, 0); set_led_rgb(19, 1, 13, 6, 1);
