Addressing Neopixels as a single LED

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.
Locked
User avatar
Another_Michael
 
Posts: 1
Joined: Thu Sep 11, 2014 11:55 pm

Addressing Neopixels as a single LED

Post by Another_Michael »

Is it possible to treat neopixels like a simple LED? I am trying to control them through a pwm pin via Max 6 (maxuino). I'm not looking to individually address each pixel, in fact, I want each pixel to behave the same way. (Fade would be wonderful, I can settle for on/off) I realize this may be a task for a simple LED, but the neopixels come in a such a great pre-assemble package!

Is there any hope for me?

Any advice is much appreciated.

User avatar
SeiRruf
 
Posts: 82
Joined: Thu Sep 04, 2014 3:07 am

Re: Addressing Neopixels as a single LED

Post by SeiRruf »

Hello Another_Michael, and welcome to the Adafruit forums!

In short, no. NeoPixels may have 4 pins like an RGB LED, but these pins follow as GND, +5vdc, DataIn, and DataOut. Not GND, R, G, B.

Before I go into NeoPixels, I'll first recommend not using them for your project if you are seeking a strip of LEDs. Instead, play with a strip of good ol' RGB LEDs. You can find them in the Adafruit Shop.
https://www.adafruit.com/products/285

You will need a 12V power supply for these. Follow this handy guide on the Adafruit Learning System, and you'll be done before you know it. Yes, you'll be able to dim them via PWM. :)
https://learn.adafruit.com/rgb-led-strips/usage



To stick with NeoPixels..
The easiest way to control these would be with the Adafruit NeoPixel library. You could treat them all the same way using a compatible microcontroller. I have written you a simple example below. I would recommend this, however I am not sure of the compatibility with the maxuino, being how I am unfamilliar with that microcontroller. You may want an arduino/trinket for this project.

Sample code to treat an entire strand of NeoPixels as one LED:

Code: Select all

#include <Adafruit_NeoPixel.h>

//declare the variable 'strip' and initiate the NeoPixel Library
Adafruit_NeoPixel strip = Adafruit_NeoPixel ( 10, 7, NEO_GRB + NEO_KHZ800 );

void setup ()
{
  strip.begin (); //initialize strip
  strip.show (); //set all black

  //optional line to optimize random animations in example
  randomSeed ( analogRead(0) );
}

void loop ()
{
  stripColor ( 255, 0, 0 ); //red
  delay ( 1000 ); //1 second delay
  stripColor ( 0, 255, 0 ); //green
  delay ( 1000 ); //1 second delay
  stripColor ( 0, 0, 255 ); //blue
  delay ( 1000 ); //1 second delay
  
  //5 seconds of random colors
  for ( int x=50; x>0; x-- ) {
    stripColor ( random(256), random(256), random(256) );
    delay ( 100 );
  }
}

//set all pixels on strip a given R G B value
void stripColor ( uint8_t r, uint8_t g, uint8_t b )
{
  for ( int i=0; i<strip.numPixels(); i++ ) {
    strip.setPixelColor ( i, r, g, b );
  } strip.show ();
}
This method would allow for dimming and all of that fun stuff. :) Here's the full detailed guide if you are interested.

User avatar
frankolious
 
Posts: 1
Joined: Tue May 20, 2014 5:00 pm

Re: Addressing Neopixels as a single LED

Post by frankolious »

Good day,

I have the 2 strips of neopixels. I would like to know if it is imperative to use the Arduino to control the strip or if a normal 4 channel DMX 512 decoder could do the trick? We were having trouble , not knowing how to connect the Neopixel as they are not regular R,G,B.

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

Re: Addressing Neopixels as a single LED

Post by adafruit_support_bill »

I would like to know if it is imperative to use the Arduino to control the strip
The Neopixels require a microcontroller such as an Arduino to control them. I don't believe that a DMX controller can directly control the WS2812 Neopixel chips.

User avatar
SeiRruf
 
Posts: 82
Joined: Thu Sep 04, 2014 3:07 am

Re: Addressing Neopixels as a single LED

Post by SeiRruf »

frankolious wrote:Good day,

I have the 2 strips of neopixels. I would like to know if it is imperative to use the Arduino to control the strip or if a normal 4 channel DMX 512 decoder could do the trick? We were having trouble , not knowing how to connect the Neopixel as they are not regular R,G,B.
Your DMX controller likely can not handle NeoPixels. However if you are feeling adventurous, there are DMX controllers out there capable of such. I am not recommending any, but to get you off to the right start, here is an example of one. You might want to look around a little.
http://www.ebay.com/itm/251641951677

Keep an eye on the voltage rating. Your NeoPixel strip runs on 5Vdc. Nothing more!

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

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