Help Needed: Photon flashing code but code is not executed afterwards

Hello all,

I am a new user to circuitry inn general, and while on Youtube I found this cool tutorial for a neopixel mask. I bought all the stuff and built the mask and wired the components, but I cannot get the Photon to send the code to the mask. It appears that after I flash the code to the Photon (which does seem to work), the code is executed for a few seconds, but then the photon defaults back, and the code is no longer executed. I need some help with getting this to work, and have not found any problems reported like this on this wiki. Any help is appreciated. The GitHub bin where I copied the code as well as the tutorials I followed will be linked here. A quick response would be nice. If there is anything wrong with the code, I probably would not have noticed it, as I am new to this whole type of thing, as stated earlier. Also, I am using build 6.0 on my photon.

Thank you all!

Building tutorial: https://www.youtube.com/watch?v=KEPldnI0fgk&t
Coding tutorial: https://www.youtube.com/watch?v=ULraqEml9js
GitHub Bin: https://github.com/anthony-ngu/NeoPixelMask

What pattern does the Photon LED show when it stops working?

The particle blinks white, then green, then breathes cyan afterwords. This happens right after the photon finishes flashing.

And it’s functional while breathing cyan? Does it show any other colors when it stops working?

No other colors, but when it breathes cyan, the leds don’t light up.

Can you flash one of the demos from the neopixel library, just to see if you’ve got everything hooked up properly?
Also, breathing cyan is what you want, it’s a cloud connection, so that’s good.

Ok, I will try that out. Thank you! I will post a video soon as to what happens so you can get a better idea.

1 Like

I just tried flashing the example, it “worked”, but the same thing happened: photon flashed white, then green, then breathed blue…

That's what it's supposed to do. Breathing cyan is the default "okay" state you most likely want to be in. If that doesn't work, then I'll have to assume something in your hardware setup might be off.

Just to be sure flashing actually works, you could try the "blink an LED" example to see if the D7 LED blinks. If so, then flashing is alright, and you can once again flash the neopixel demo.

How are you powering it? Whole setup is picky about stable voltage, you need strong enough 5V power source. Your PC’s USB might not do it if powering too many pixels. You can try lowering pixel count (to let’s say 5) to test it. Also powered USB hub may help (I am powering 64 neopixel grid from that, but it still glitches occasionally).

Also neopixels use 5V logic, Particle is 3.3V. It usually works, but tolerances for wiring glitches are lower (too long wires, imperfect contact ie. on breadboard etc.)

1 Like

should I try a shorter wire? I am powering using a USB power pack…

I just flashed the code and it worked (blink an LED). do you think that the wire length is too long?

Well, the device & code seem to be okay, so a hardware issue is likely. Any chance we could get some detailed images of your setup?

I shall post an image in just a few minutes.

Got the upload finally… :joy:

It looks okay~ish, though it’s hard to see. I do notice an awful lot of wire splices. I’m not sure how well those worked out, so it might be good to check those with a multimeter if you’ve got access to one.
And like mentioned before, longer wire runs to the pixels might cause issues due to other voltage levels.

If you are powering all these NeoPixels via USB -> Photon -> Vin -> LEDs these are definetly too many for the Photon to power.

You may want to read thoroughly the Adafruit NeoPixel Überguide , it could help you understand all of the electronic basics you need to put into your circuit… even though the initial creator of the mask may not have heeded all of Adafruit’s advice. It will also explain the power requirements, which on your project could be considerably more than your particle can deliver depending on how many pixels are lit, and which colors are being lit, as @ScruffR pointed out.

Also, I’d recommend starting with learning how to use the library by lighting a single Neopixel and manipulating its color. Once you understand the basics of the library, you will also be able to control the amount of power and keep it in line with your power source (once properly wired up).

2 Likes