i want to use 11 yr Flora RGB pixel v2 on a wearable project

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
adafruit_support_bill
 
Posts: 88136
Joined: Sat Feb 07, 2009 10:11 am

Re: i want to use 11 yr Flora RGB pixel v2 on a wearable pro

Post by adafruit_support_bill »

It looks like you have the right number of pixels defined for your strip:

Code: Select all

Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);
And all the calculations are based on strip.numPixels(), so it is probably a problem with the wiring, or possibly one of the pixels. From what I can see, your wiring looks good. You can try adding a jumper to bypass the first non-working pixel. If the next pixel in the strand lights up, then we can replace the bad pixel.

User avatar
gdgarced
 
Posts: 179
Joined: Thu Mar 03, 2011 11:53 pm

Re: i want to use 11 yr Flora RGB pixel v2 on a wearable pro

Post by gdgarced »

Help, i was able to use the code above for fashion show but i have been trying to change the color of my LEDS to emerald green and my LEDs stay white. I compile, and it uploads but i don't get green, please help. I want to wear theses to FIT's pet fashion show this friday in NY. this is my code, By the way, Im not a programmer i have been getting help for folks who do program. is there something missing in here? this is after changes were made to the first code but its still not giving me green. My trinkets are fine so i don't know what to do. Thanks

Code: Select all

 #include <Adafruit_NeoPixel.h>

#define PIN 13

// Here is where you can put in your favorite colors that will appear!
// just add new {nnn, nnn, nnn}, lines. They will be picked out randomly
//                                  R   G   B

uint8_t myFavoriteColors[][3] = {{27, 207, 83},   // Pink
                                 {27, 207, 83},   // Pink
                                 {27, 207, 83}   // Pink
                               };

// don't edit the line below
#define FAVCOLORS sizeof(myFavoriteColors) / 3

// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)
//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}

void loop() {
  int del = 110;
  // Some example procedures showing how to display to the pixels:
  //colorWipe(strip.Color(250, 100, 255), 100); // Purple
  flashRandom(del, 10);

  flashRandom(del, 15);
  flashRandom(del, 20);
  flashRandom(del, 15);
  flashRandom(del, 1);
  flashRandom(del, 18);
  flashRandom(del, 16);
  flashRandom(del, 30);
  flashRandom(del, 5);
  flashRandom(del, 12);
  flashRandom(del, 6);
  flashRandom(del, 10);
      
/*  colorWipe(strip.Color(200, 0, 200), 50); // Purple
  colorWipe(strip.Color(200, 200, 200), 50); // White
  colorWipe(strip.Color(200, 80, 120), 50); // Pink
  colorWipe(strip.Color(000, 000, 000), 50); // OFF
  */
  
}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }
}

void rainbow(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256; j++) {
    for(i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel((i+j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
    for(i=0; i< strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
  if(WheelPos < 85) {
   return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
  } else if(WheelPos < 170) {
   WheelPos -= 85;
   return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  } else {
   WheelPos -= 170;
   return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
}



void flashRandom(int wait, uint8_t howmany) {
 
  for(uint16_t i=0; i<howmany; i++) {
    // pick a random favorite color!
    int c = random(FAVCOLORS);
    int red = myFavoriteColors[c][0];
    int green = myFavoriteColors[c][1];
    int blue = myFavoriteColors[c][2]; 
 
    // get a random pixel from the list
    int j = random(strip.numPixels());
    //Serial.print("Lighting up "); Serial.println(j); 
    
   
// now we will 'fade' it in 5 steps
      strip.setPixelColor(j, strip.Color(red, green, blue));
      strip.show();
      delay(wait);
      strip.setPixelColor(j, strip.Color(0, 0, 0));
      strip.show();


  }
  // LEDs will be off when done (they are faded to 0)
}
Last edited by adafruit_support_bill on Thu May 01, 2014 6:20 am, edited 1 time in total.
Reason: please use the code button when submitting code. press [Code], then paste your code between the [code] [/code] tags.

User avatar
adafruit_support_bill
 
Posts: 88136
Joined: Sat Feb 07, 2009 10:11 am

Re: i want to use 11 yr Flora RGB pixel v2 on a wearable pro

Post by adafruit_support_bill »

If you want Emerald green, I'd start with shades of pure green.

Code: Select all

uint8_t myFavoriteColors[][3] = {{0, 100,0},   // dim green
                                 {0, 180, 0},   // medium Green
                                 {0, 255, 0}   // bright Green

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”