Running Audio and Neopixels at the same time with Prop Sheild

Status
Not open for further replies.

Waterme11on

Active member
Hey there,
I'm trying to run the audio library whilst animating neopixels, but I need some help. My setup is a teensy 3.2 with a prop shield, a 16 led neopixel ring connected to pin 8 on the teensy, and a single speaker on the prop shield amp. I'm powering the device with a sparkfun 5v/1A charger/booster board and a 2000Mah battery. Worth noting is that I have a Hc05 bluetooth unit also connected to pins 1 and 2, not sure if this effects things.

Here's what i've tried:

1. Adafruit neopixel library
This works fine for lighting and animating the lights however the audio will hang when the lights are being animated. I've read this is because the adafruit library blocks interrupts or something.
However the audio will come through fine when the lights are on a static colour.

2. OctoWS2812 Library
This works for lighting up the ring but no audio will come out when I have the lights running, animated or not.

3. WS2812Serial Library
I cant even get the lights working with this library, just using the basic example, having changed my pin number to 8 in the code and nothing happens when I run it.
It seems that this was designed specifically for the purpose i'm after but I can't get it to work at all, any help would be appreciated.

That's all I've got, I was only testing with the example sketches so I have no code to post.

Cheers
 
Hey So i figured out why the WS2812 Library wasn't working, kinda. I moved the leds to pin 1 instead of 8 and it worked. However I don't know why pin 8 wasn't working, it says it's a supported pin in the readme...
 
WS2812Serial is the best choice.

3. WS2812Serial Library
I cant even get the lights working with this library, just using the basic example, having changed my pin number to 8 in the code and nothing happens when I run it.

Looks like there's a bug with pins 8 and 20.

The simplest solution would be the use pin 1, 5, 10 or 31.

If you really want to use pin 8, copy this file to the WS2812Serial library folder. Also set Tools > CPU Speed to 120 MHz overclock.
 

Attachments

  • WS2812Serial.cpp
    6.1 KB · Views: 63
Awesome thanks,
Do you recommend setting the cpu speed to 120mhz for general Audio+Led use or just if I want to use pin 8?

Also I'm using the IMU to control parameters like volume/frequency for my audio, but it's proving to be difficult in conjunction with animated leds, as most of the examples use some kind of delay.
I was going to wait until I knew more about how led animations work before making a thread asking for help but if you could point me in the right direction for getting Audio, motion, and leds working all at once that would be amazing.
 
Status
Not open for further replies.
Back
Top