Since there are no tutorials for the NeoPixel Strip's And I'm Finally getting the hang of coding it.....I thought I'd share this Example I made of a Scrolling Cylon Eye!!!
Video: http://www.youtube.com/watch?v=UW2_cEKGV68
Things you will need:
1. 1x Strip of the NeoPixel: http://www.adafruit.com/products/1376 (or you can use the NeoPixel Stick/Bar -> http://www.adafruit.com/products/1426 )
2. 1x Arduino(I have the Arduino Uno[ATMEGA328P-PU]): http://www.adafruit.com/products/50
3. The Arduino Programming Software: http://arduino.cc/en/Main/Software
4. The Library from here: https://github.com/adafruit/Adafruit_NeoPixel
And Finally Here's the Code: https://github.com/EternalCore/NeoPixel ... olling_Eye
Changes:
v1.10 - Added NeoPixel Bar/Stick option.
Other Helpful Threads I created:
[101-Help]~12v -> 5v 1.5A Regulated PowerCircuit For NeoPixels.
[101-Help]~12v -> 5v 3A Parallel Regulated PowerCircuit For NeoPixels.
Hope you enjoy it As I May make more examples.
[Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 239
- Joined: Tue Jul 30, 2013 3:57 pm
[Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!
Last edited by EternalCore on Thu Sep 19, 2013 3:14 am, edited 9 times in total.
- adafruit_support_bill
- Posts: 88037
- Joined: Sat Feb 07, 2009 10:11 am
Re: [Example]NeoPixel Strip Scrolling Cylon Eye!
Cool Thanks for posting!
-
- Posts: 239
- Joined: Tue Jul 30, 2013 3:57 pm
Re: [Example]NeoPixel Strip Scrolling Cylon Eye!
You're Welcome. And you are welcome to add this to your examples in your Library files.adafruit_support_bill wrote:Cool Thanks for posting!
Updated to v1.02: Fixed to use the whole strip of 60 leds again.
-
- Posts: 239
- Joined: Tue Jul 30, 2013 3:57 pm
Re: [Example]NeoPixel Strip Scrolling Cylon Eye!
Updated to v1.03: Minor Setting fixes to speed up the performance.
-
- Posts: 239
- Joined: Tue Jul 30, 2013 3:57 pm
Re: [Example]NeoPixel Strip Scrolling Cylon Eye!
UPDATE: Added Video -> http://www.youtube.com/watch?v=UW2_cEKGV68
- ohararp
- Posts: 12
- Joined: Sun Aug 27, 2006 9:59 am
Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!
Eternalcore, I had been meaning to code up a similar cylon scanner code for a simple 1x8 matrix for sometime. Thanks for sharing/posting! I was able to include your code in my kickstarter video at the 3:23 mark of the video http://kck.st/1cyHkAj.
-
- Posts: 239
- Joined: Tue Jul 30, 2013 3:57 pm
Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!
Nice!ohararp wrote:Eternalcore, I had been meaning to code up a similar cylon scanner code for a simple 1x8 matrix for sometime. Thanks for sharing/posting! I was able to include your code in my kickstarter video at the 3:23 mark of the video http://kck.st/1cyHkAj.
For the 1x8 bar you can just comment out these lines so it only uses 3leds:
For Scan Up:
Code: Select all
//strip.setPixelColor(i+2, Ctt); //Third Dot Color
strip.setPixelColor(i+1, Ct); //Second Dot Color
strip.setPixelColor(i, Co); //Center Dot Color
strip.setPixelColor(i-1, Ct); //Second Dot Color
//strip.setPixelColor(i-2, Ctt); //Third Dot Color
//And change this line below to this
strip.setPixelColor(i-2, strip.Color(0,0,0)); //Clears the dots after the 3rd color
Code: Select all
//strip.setPixelColor(i-2, Ctt); //Third Dot Color
strip.setPixelColor(i-1, Ct); //Second Dot Color
strip.setPixelColor(i, Co); //Center Dot Color
strip.setPixelColor(i+1, Ct); //Second Dot Color
//strip.setPixelColor(i+2, Ctt); //Third Dot Color
//And change this line below to this
strip.setPixelColor(i+2, strip.Color(0,0,0)); //Clears the dots after the 3rd color
-
- Posts: 2
- Joined: Mon Aug 26, 2013 12:33 am
Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!
This is practically exactly what I need for my PAX project! Thanks for forcing me to read annotations in arduino.
I was wondering, is there a way to control how fast the eye scrolls?
I was wondering, is there a way to control how fast the eye scrolls?
-
- Posts: 239
- Joined: Tue Jul 30, 2013 3:57 pm
Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!
Yes by Changing the number on this line in the code:gozeeta wrote:This is practically exactly what I need for my PAX project! Thanks for forcing me to read annotations in arduino.
I was wondering, is there a way to control how fast the eye scrolls?
Code: Select all
int wait_T=40; //This is the delay between moving back and forth and per pixel
-
- Posts: 2
- Joined: Mon Aug 26, 2013 12:33 am
Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!
Awesome! Thanks! Playing around, I'm trying to make the eye go only one way, have a shorter overall width (3 LED instead of 5), and waiting a couple seconds between each "pulse." Here's what I have so far:
But now that I've removed the scroll down, the last two pixels at the end never turn off! I wonder what I did wrong...
Code: Select all
void loop() {
//Example: CylonEyeUp(Center_Dot_Color, Second_Dot_color, Third_Dot_color, wait_T, PixelCount, Pixel_Start_End);
CylonEyeUp(strip.Color(250,161,0), strip.Color(255,143,0), wait_T, PixelCount, Pixel_Start_End);
delay(wait_T);
strip.show();
//Example: CylonEyeDown(Center_Dot_Color, Second_Dot_color, Third_Dot_color, wait_T, PixelCount, Pixel_Start_End);
delay(2000);
}
void CylonEyeUp(uint32_t Co, uint32_t Ct, uint8_t Delay, int TotalPixels, int pStart) {
for(int i=pStart; i<TotalPixels; i++) {
strip.setPixelColor(i+1, Ct); //Second Dot Color
strip.setPixelColor(i, Co); //Center Dot Color
strip.setPixelColor(i-1, Ct); //Second Dot Color
strip.setPixelColor(i-2, strip.Color(0,0,0)); //Clears the dots after the 3rd color
strip.show();
//Serial.println(i); //Used For pixel Count Debugging
delay(Delay);
}
}
-
- Posts: 239
- Joined: Tue Jul 30, 2013 3:57 pm
Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!
Here you go I added a new script just for you, for what you are trying to do: https://github.com/EternalCore/NeoPixel ... OneWay.inogozeeta wrote:Awesome! Thanks! Playing around, I'm trying to make the eye go only one way, have a shorter overall width (3 LED instead of 5), and waiting a couple seconds between each "pulse." Here's what I have so far:
But now that I've removed the scroll down, the last two pixels at the end never turn off! I wonder what I did wrong...Code: Select all
-snip-
To change the timing of between pulses change the number in int 'refresh', to change the speed of it scrolling change the number in int 'wait_T' and 1000 is equal to 1second.
-Enjoy
- mordecai131
- Posts: 14
- Joined: Thu Sep 19, 2013 1:49 am
Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!
Hey EternalCore, I saw in your first post that your code would need some tweaking to work with the NeoPixel sticks. What things need to be tweaked to get the stick to work? I have tried the sample test code that Adafruit provided and wasn't able to figure it out either. Any help is greatly appreciated. Thanks.
-
- Posts: 239
- Joined: Tue Jul 30, 2013 3:57 pm
Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!
I've been busy so I haven't had time to update this script, but I have time now so give me a few to add it and I'll post an update here. Just keep refreshing until you see my next post.mordecai131 wrote:Hey EternalCore, I saw in your first post that your code would need some tweaking to work with the NeoPixel sticks. What things need to be tweaked to get the stick to work? I have tried the sample test code that Adafruit provided and wasn't able to figure it out either. Any help is greatly appreciated. Thanks.
-
- Posts: 239
- Joined: Tue Jul 30, 2013 3:57 pm
Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!
UPDATED: v1.10 - Added option for the NeoPixel Bar/Stick to change the size of the scanner leds between 5(for Strip) and 3(for Bar/Stick).
- mordecai131
- Posts: 14
- Joined: Thu Sep 19, 2013 1:49 am
Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!
Thank you for going through all that, unfortunately it's not working for me for some reason. I believe I used the code properly but I have a feeling it may be the type of board I'm using, chipKit uC32. After some experimenting I found that if I run 12 volts through the AC plug on the board and bypass the 5 volt regulator I can get the sticks to flash a pinkish color. But it does not respond to the code, even if I unplug the signal wire, reset the board, and even upload new code to the board which normally resets it as well the sticks continue to blink.
Please be positive and constructive with your questions and comments.