12mm Diffused Thin Digital RGB LED Pixels (Strand of 25) not working?

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
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: 12mm Diffused Thin Digital RGB LED Pixels (Strand of 25) not working?

Post by pburgess »

Hi Rads,

I do apologize for the slowness of this...it's simply an unprecedented situation and I've been trying to come up with an explanation and a plan for debugging it, or puzzling over if we're just not getting something through to each other. Let's try this:

Please bring up the strandtest sketch that's included with the Adafruit_WS2801 library.

Change lines 30 and 31 as follows:

Code: Select all

int dataPin  = 11;    // Yellow wire on Adafruit Pixels
int clockPin = 13;    // Green wire on Adafruit Pixels
And leave the standard strip declaration in place (DO NOT use the SPI version yet):

Code: Select all

Adafruit_WS2801 strip = Adafruit_WS2801(25, dataPin, clockPin);
Connect the LED strand to pins 11 & 13 and upload this sketch to the board.

If this fails: my only explanation is that the Arduino is defective. If it was purchased from Adafruit, we'll replace it. (And if elsewhere...was it an "eBay special"? Because it sure looks like the genuine deal.)
If this works: getting into Twilight Zone territory. Leave the wiring where it is on 11 & 13, and let's do that thing with the sketch again for hardware SPI. Comment out line 37, enable line 41:

Code: Select all

//Adafruit_WS2801 strip = Adafruit_WS2801(25, dataPin, clockPin);
Adafruit_WS2801 strip = Adafruit_WS2801(25);
Upload revised sketch and observe results.

If this works: you should be able to upload LEDstream at this point.
If this fails: cue theremin music, I'm baffled. You'll need to edit the library source file Adafruit_WS2801.cpp, and look for the 'startSPI' function around line 108. Last line of the function should normally be:

Code: Select all

    SPI.setClockDivider(SPI_CLOCK_DIV16); // 1 MHz max, else flicker
Let's change it to:

Code: Select all

    SPI.setClockDivider(SPI_CLOCK_DIV128); // 125 KHz
This throttles back the SPI speed to its lowest possible setting.

Re-compile the sketch and upload to board.

If this works: substitute SPI_CLOCK_DIV64 and SPI_CLOCK_DIV32 (and the original SPI_CLOCK_DIV16 if these both work), compile/upload, try to narrow down the point of failure.
If this fails: weird science fiction stuff is happening. Try connecting the Arduino to each of the other strands and see if the same phenomenon is observed, or if it's limited to one specific strand. If just the one strand, try moving that one later in the chain and see if the whole string then works.

If after all this we're still hitting a brick wall, this defies all logic and exceeds my ability to diagnose, in which case I will personally wire up and test an identical setup and send you the known working combination directly off my desk. Because I can't explain what you're seeing.

User avatar
rads
 
Posts: 17
Joined: Thu Jan 24, 2013 3:21 am

Re: 12mm Diffused Thin Digital RGB LED Pixels (Strand of 25) not working?

Post by rads »

Hi Phillip,

Sorry for not getting back but been on vacation and this is the first chance i've had. Anyhow, it looks like the Arduino is defective, I modified the strandtest sketch with pins 11 and 13 but nothing worked, I checked voltage and this was 5.3V.

Loaded the original sketch (with pins 2 and 3), uploaded and hey presto...I've got multicolour led cycling.

It was purchased from you, but I'm quite some distance (international) so not really worth sending back to you. If you can set me up an arduino that actually works I'll just buy it from you.

Let me know what my next steps are to make sure the one you setup is allocated to me.

User avatar
rads
 
Posts: 17
Joined: Thu Jan 24, 2013 3:21 am

Re: 12mm Diffused Thin Digital RGB LED Pixels (Strand of 25) not working?

Post by rads »

Trying to keep the thread active so I can eventually have a workign adalight system :wink:

Taigitsune
 
Posts: 1
Joined: Wed Feb 27, 2013 3:28 am

Re: 12mm Diffused Thin Digital RGB LED Pixels (Strand of 25) not working?

Post by Taigitsune »

Not to BANNED this thread, but if it helps I'm running into the same problem with a strand of 100 pixels and a Mega 2560. Granted, I didn't obtain either from you and will probably be picking up an actual Uno R3 tomorrow, but if I can help provide more information in any way I'll be happy to.

Thus far I'm able to run strandtest without issue on pins 11 and 13 until I enable SPI per your examples. After that, blotto.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: 12mm Diffused Thin Digital RGB LED Pixels (Strand of 25) not working?

Post by pburgess »

Taigitsune: refer to the posts in this thread regarding pin numbers and the Mega. You don't want to use 11 and 13.

User avatar
XW4
 
Posts: 18
Joined: Sat Jun 14, 2014 6:06 pm

Re: 12mm Diffused Thin Digital RGB LED Pixels (Strand of 25)

Post by XW4 »

i buy from adafruit :

-1 x arduino Uno R3
-1x flat 12mm pixel WS2801
-5V 2A power supply

i install Adafruit_WS2801 properly.

i can compile and upload in Uno the strandtest sketch without change anything.

Only the second pixel of the strand light up Blue color.

I read so carefully all guide and this present post and check all my wires several times but always same result.

here a picture of my wires :
Image

Here the code :

Code: Select all

#include "Adafruit_WS2801.h"
#include "SPI.h" // Comment out this line if using Trinket or Gemma
#ifdef __AVR_ATtiny85__
 #include <avr/power.h>
#endif

/*****************************************************************************
Example sketch for driving Adafruit WS2801 pixels!


  Designed specifically to work with the Adafruit RGB Pixels!
  12mm Bullet shape ----> https://www.adafruit.com/products/322
  12mm Flat shape   ----> https://www.adafruit.com/products/738
  36mm Square shape ----> https://www.adafruit.com/products/683

  These pixels use SPI to transmit the color data, and have built in
  high speed PWM drivers for 24 bit color per pixel
  2 pins are required to interface

  Adafruit invests time and resources providing this open source code, 
  please support Adafruit and open-source hardware by purchasing 
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.  
  BSD license, all text above must be included in any redistribution

*****************************************************************************/

// Choose which 2 pins you will use for output.
// Can be any valid output pins.
// The colors of the wires may be totally different so
// BE SURE TO CHECK YOUR PIXELS TO SEE WHICH WIRES TO USE!
uint8_t dataPin  = 2;    // Yellow wire on Adafruit Pixels
uint8_t clockPin = 3;    // Green wire on Adafruit Pixels

// Don't forget to connect the ground wire to Arduino ground,
// and the +5V wire to a +5V supply

// Set the first variable to the NUMBER of pixels. 25 = 25 pixels in a row
Adafruit_WS2801 strip = Adafruit_WS2801(25, dataPin, clockPin);

// Optional: leave off pin numbers to use hardware SPI
// (pinout is then specific to each board and can't be changed)
//Adafruit_WS2801 strip = Adafruit_WS2801(25);

// For 36mm LED pixels: these pixels internally represent color in a
// different format.  Either of the above constructors can accept an
// optional extra parameter: WS2801_RGB is 'conventional' RGB order
// WS2801_GRB is the GRB order required by the 36mm pixels.  Other
// than this parameter, your code does not need to do anything different;
// the library will handle the format change.  Examples:
//Adafruit_WS2801 strip = Adafruit_WS2801(25, dataPin, clockPin, WS2801_GRB);
//Adafruit_WS2801 strip = Adafruit_WS2801(25, WS2801_GRB);

void setup() {
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000L)
  clock_prescale_set(clock_div_1); // Enable 16 MHz on Trinket
#endif

  strip.begin();

  // Update LED contents, to start they are all 'off'
  strip.show();
}


void loop() {
  // Some example procedures showing how to display to the pixels
  
  colorWipe(Color(255, 0, 0), 50);
  colorWipe(Color(0, 255, 0), 50);
  colorWipe(Color(0, 0, 255), 50);
  rainbow(20);
  rainbowCycle(20);
}

void rainbow(uint8_t wait) {
  int i, j;
   
  for (j=0; j < 256; j++) {     // 3 cycles of all 256 colors in the wheel
    for (i=0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel( (i + j) % 255));
    }  
    strip.show();   // write all the pixels out
    delay(wait);
  }
}

// Slightly different, this one makes the rainbow wheel equally distributed 
// along the chain
void rainbowCycle(uint8_t wait) {
  int i, j;
  
  for (j=0; j < 256 * 5; j++) {     // 5 cycles of all 25 colors in the wheel
    for (i=0; i < strip.numPixels(); i++) {
      // tricky math! we use each pixel as a fraction of the full 96-color wheel
      // (thats the i / strip.numPixels() part)
      // Then add in j which makes the colors go around per pixel
      // the % 96 is to make the wheel cycle around
      strip.setPixelColor(i, Wheel( ((i * 256 / strip.numPixels()) + j) % 256) );
    }  
    strip.show();   // write all the pixels out
    delay(wait);
  }
}

// fill the dots one after the other with said color
// good for testing purposes
void colorWipe(uint32_t c, uint8_t wait) {
  int i;
  
  for (i=0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }
}

/* Helper functions */

// Create a 24 bit color value from R,G,B
uint32_t Color(byte r, byte g, byte b)
{
  uint32_t c;
  c = r;
  c <<= 8;
  c |= g;
  c <<= 8;
  c |= b;
  return c;
}

//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 Color(WheelPos * 3, 255 - WheelPos * 3, 0);
  } else if (WheelPos < 170) {
   WheelPos -= 85;
   return Color(255 - WheelPos * 3, 0, WheelPos * 3);
  } else {
   WheelPos -= 170; 
   return Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
}
Thanks if you can help me

User avatar
XW4
 
Posts: 18
Joined: Sat Jun 14, 2014 6:06 pm

Re: 12mm Diffused Thin Digital RGB LED Pixels (Strand of 25)

Post by XW4 »

Ok so Since my lastpost, i suspected maybe the first pixel led strand be defective so i cut it...and guest what....now the first pixel draw all cycle color code like suppose but only first pixel...not the 23 others in the strand.


Iam shure iam close to solved this issue. Is look my first pixel of 25 led strand be defective.....after cut, first pixel of 24 work and play the code strandtest without any change in the code...on Uno pin 2 and 3 like my previous post in this thread (see picture)

i suspect all my entire strand be defective. Maybe a refund could be possible. or any other think i dont made correctly.

i project to use an undred of this strand pixel for a big project soon but the prototype strand now is make me feel no confident to move on.


thanks if you have a clue on what its could be the issue. Frenchy Kong

User avatar
Wclown
 
Posts: 1
Joined: Thu Jun 13, 2019 11:29 pm

Re: 12mm Diffused Thin Digital RGB LED Pixels (Strand of 25)

Post by Wclown »

I see this thread is dead, but I have the exact same problem. Only the first LED lights up. Very Frustrating.

User avatar
kcl1s
 
Posts: 1512
Joined: Tue Aug 30, 2016 12:06 pm

Re: 12mm Diffused Thin Digital RGB LED Pixels (Strand of 25)

Post by kcl1s »

Best to start your own thread. Show pictures (800x600) of your wiring and hardware. Post the code you are using between code tags (button above edit window). The Adafruit techs will get you sorted out.

Fellow hobbyist
Keith

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

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