Trying to get Neopixels to work with Lilypad MP3

Anyone have experience getting this to work with neopixels and the neopixel library?

On my Flora, I have the neopixel powered from the vbatt and signal coming out of D6 pin, and this code works fine:

#include <Adafruit_NeoPixel.h>

int PIXEL_COUNT = 1;
int dPin = 6;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, dPin, NEO_GRB + NEO_KHZ800);
uint32_t baseColour;
uint32_t otherColour;
int swap = false;

void setup()
{
  strip.begin();
  baseColour = strip.Color(100, 0, 000);
  otherColour = strip.Color(0, 100, 0);  
}


void loop()
{
  if (swap)
  {
    strip.setPixelColor(0, baseColour);
  }
  else
  {
     strip.setPixelColor(0, otherColour);
  }
  strip.show();
  swap = !swap;
  
  delay(1000);
}

When I hook up my Lilypad MP3, also powering from its vbatt and signal line to TRIG1, and running the same code (but changed dPin = 23 to match), the pixel doesn’t light up. I know it’s the right pin because I’ve run a simple blink test on it and a simple LED blinks.

What I noticed is different is:

On Flora,

  1. Voltage across the neopixel power terminals is about 3.9

  2. Voltage across the signal to ground is around 0.

On Lilypad MP3,

  1. Voltage across the neopixel power terminals is about 4.1

  2. Voltage across the signal to ground is constantly about 3. !!! This has to be wrong?

But what does this mean and how do I fix it?

I am using the same 3.7V 1300mAh Lion battery to power both.

I want to run a neopixel strip from the Lilypad MP3 and it works from the Flora, but for this test I used a Flora neopixel v2.

Here’s the datasheet for the Lilypad MP3

http://dlnmh9ip6v2uc.cloudfront.net/dat … 3-v15a.pdf

Thank you in advance for any help! XD

Ok so I noticed 2 more things different.

When I digitalWrite(pin, LOW) on lilypad trig1 the pin goes to about 2.4V and when I digitalWrite(pin, HIGH) the pin goes to 0. On the Flora, it’s the opposite, and the pin voltage is higher too, about 3.4V.

I guess that explains why it doesn’t work. Um, so now what? Thanks.

Sounds like a missing ground wire. The batttery - terminal, Neopixel gnd pin and Lilypad MP3 gnd pin must all be connected together. Check your wires.

Ok, so I figured out what was wrong!

  1. TRIG1 to TRIG5 on the Lilypad MP3 are pulled up by an internal resistor. This explains the behaviour.

  2. I did have the wrong pin numbers! Apparently those numbers next to the pins in the schematic are not the pin numbers you use to program. I think the pin numbers to use are the “virtual” ones mapped by Wire.h? (So I’m wondering why the LED reacted in a blink test.)

  3. The winning setup was:

Connect neopixel power terminals 3.3V out and ground on the Lilypad MP3. Connect the signal line to one of the pins used for the rotary encoder (I used one of the digital pins.) So simple!