   leds[pos] += CHSV( gHue + random8(64), 200, 255);
 }
 
-void sinelon()
+void sinelon()  
 {
   // a colored dot sweeping back and forth, with fading trails
   fadeToBlackBy( leds, NUM_LEDS, 10);
-    int pos = beatsin16(7,0,NUM_LEDS);
+    int pos = beatsin16(15,0,NUM_LEDS);
     //int pos = beat16(13);
   leds[pos] += CHSV( gHue, 255, 192);
+  leds[NUM_LEDS-pos] += CHSV( gHue, 255, 192);
+  
 }
 
 void bpm()

#error "Requires FastLED 3.1 or later; check github for latest code."
#endif

#define DATA_PIN    8
//#define CLK_PIN   4
#define LED_TYPE    WS2811
#define COLOR_ORDER GRB
#define NUM_LEDS    1
CRGB leds[NUM_LEDS];

#define BRIGHTNESS          127
#define FRAMES_PER_SECOND  120
bool DirectionalThreshold;  //whether the compass threshold can be used
bool Dance;                 //whether accelerometer is dancing hard enought to be used


void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
   accel.begin();
   pinMode(10, INPUT_PULLUP);
   pinMode(9, INPUT_PULLUP);
     // tell FastLED about the LED strip configuration
  FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
  //FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);

    FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);

  // set master brightness control
  FastLED.setBrightness(BRIGHTNESS);
}
typedef void (*SimplePatternList[])();
SimplePatternList gPatterns = { rainbow, rainbowWithGlitter, confetti, sinelon, juggle, bpm };

  
   bool didUpdate = accel.Update();
    phase.update(accel.getLinearAcceleration());

    EVERY_N_MILLISECONDS ( 30 )
    {
      gHue++;
    }
    if (millis() - LastUpdate > Interval)
    {
        LastUpdate = millis();
        FastLED.show();
        if (accel.isDancing()) {

            computed_bpm(phase.getPhasePercentage() * 256);
         }
        
         else if (digitalRead(9) == LOW) {

            sinelon();
            
        }

        else if (digitalRead(10) == LOW)
        {
            confetti();
        }
        else
        { 
          //Quaternion device = accel.getDeviceOrientation(Quaternion(1, 0, 0));
          Quaternion device = accel.getAbsoluteOrientation(Quaternion(1, 0, 0));
          float x = device.b < 0 ? 0 : device.b;
          float y = device.c < 0 ? 0 : device.c;
          float z = device.d < 0 ? 0 : device.d;

            rgb(x*64, y*64, z*64);
        }
    }
}

