Adafruit Flora RGB Smart Pixel

This is a special forum devoted to educators using Adafruit and Arduino products for teaching.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
katehartman
 
Posts: 2
Joined: Sat Dec 08, 2012 12:40 pm

Adafruit Flora RGB Smart Pixel

Post by katehartman »

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

#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;
}


User avatar
bekathwia
 
Posts: 215
Joined: Sat Dec 25, 2010 1:18 am

Re: Adafruit Flora RGB Smart Pixel

Post by bekathwia »

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
katehartman
 
Posts: 2
Joined: Sat Dec 08, 2012 12:40 pm

Re: Adafruit Flora RGB Smart Pixel

Post by katehartman »

Ah, good to know. Thanks!

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

Return to “For Educators”