/*
* Steve Barth 
*   2022
*/

#include <Adafruit_NeoPixel.h>

#define PIN       2 // drive pin
#define NUM_LEDS 64 //32 
#define delayval 20

Adafruit_NeoPixel ring = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB);

int sine[] = // total pixels in array
{
   // 4 ring total 70
  4,  3,  2,  1,  0, 15, 14, 13, 12, 20, 21, 22, 23, 24, 25, 26, 27, 28,
  36, 35, 34, 33, 32, 47, 46, 45, 44, 52, 53, 54, 55, 56, 57, 58, 59, 60,
  61, 62, 63, 48, 49, 50, 51, 52, 44, 43, 42, 41, 40, 39, 38, 37, 36, 28,
  29, 30, 31, 16, 17, 18, 19, 20, 12, 11, 10,  9,  8,  7,  6,  5
  //*/
  /*   // 2 ring total 34
  5, 4,  3,  2,  1, 15, 14, 13, 12, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 
  30, 31, 16, 17, 18, 19, 20, 12, 11, 10,  9,  8,  7,  6,  5,  4, 
  */
};

uint32_t color = ring.Color(255, 50, 5); // color R-G-B

void setup() 
{
  ring.begin();
  ring.setBrightness(255);  // 0-255 brightness
  ring.clear();             // clear all pixels
}

void loop() {
  for (int i = 0; i < 70/*34*/; i++)                // animation length
  {
    ring.setPixelColor(sine[i],0);                  // not used pixel off
    ring.setPixelColor(sine[(i + 7) % 70 ], color); // setting pixel animation
    ring.show();                                    // show animation
    delay(delayval);                                // animation speed setting
  }
}