Adafruit Flora RGB Smart Pixel
Moderators: adafruit_support_bill, adafruit

Adafruit Flora RGB Smart Pixel

by katehartman on Sat Dec 08, 2012 11:56 am

I'm trying to create an extremely bare bones example with a single pixel, based off of "floratest". However I'm finding red & green are swapped. Rather than lighting RED, GREEN, BLUE, the pixels lights GREEN, RED, BLUE with the code below. Anyone else having this problem?

Code: Select all | TOGGLE FULL SIZE
#include "Adafruit_FloraPixel.h"
Adafruit_FloraPixel strip = Adafruit_FloraPixel(1);

void setup() {
  strip.begin();
  strip.show();
}

void loop() {
  strip.setPixelColor(0, Color(255, 0, 0));
  strip.show();
  delay(500);

  strip.setPixelColor(0, Color(0, 255, 0));
  strip.show();
  delay(500);

  strip.setPixelColor(0, Color(0, 0, 255));
  strip.show();
  delay(500);

  strip.setPixelColor(0, Color(0, 0, 0));
  strip.show();
  delay(1000);
}


RGBPixel Color(byte r, byte g, byte b)
{
  RGBPixel p;

  p.red = r;
  p.green = g;
  p.blue = b;

  return p;
}

katehartman
 
Posts: 2
Joined: Sat Dec 08, 2012 11:40 am

Re: Adafruit Flora RGB Smart Pixel

by bekathwia on Sun Dec 09, 2012 1:58 pm

Hey Kate,

You (and I) received an early batch of smart pixels, which were made with GRB LEDs, not RGB LEDs. They'll work fine (with two color channels reversed in your code) so long as they're not combined in the same chain with RGB pixels. Lucky you, limited edition! :D

None of the production starter packs or pixels will have this issue, we made sure! If you need more GRB pixels for a project, though, let me know.
User avatar
bekathwia
 
Posts: 143
Joined: Sat Dec 25, 2010 12:18 am

Re: Adafruit Flora RGB Smart Pixel

by katehartman on Sun Dec 09, 2012 11:00 pm

Ah, good to know. Thanks!
katehartman
 
Posts: 2
Joined: Sat Dec 08, 2012 11:40 am