[Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!
Moderators: adafruit_support_bill, adafruit

[Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!

by EternalCore on Wed Jul 31, 2013 8:47 am

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. :D
Last edited by EternalCore on Thu Sep 19, 2013 3:14 am, edited 9 times in total.
Things I've Made Here:
1.[101-Help]~12v -> 5v 1.5A Regulated Power For NeoPixels.: http://goo.gl/uMXuk7
2.[Example]NeoPixel Strip Scrolling Cylon Eye!: http://goo.gl/4RzWQQ
User avatar
EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm
Location: Canada

Re: [Example]NeoPixel Strip Scrolling Cylon Eye!

by adafruit_support_bill on Wed Jul 31, 2013 9:42 am

Cool :D Thanks for posting!
User avatar
adafruit_support_bill
 
Posts: 30123
Joined: Sat Feb 07, 2009 10:11 am

Re: [Example]NeoPixel Strip Scrolling Cylon Eye!

by EternalCore on Wed Jul 31, 2013 3:06 pm

adafruit_support_bill wrote:Cool :D Thanks for posting!

You're Welcome. And you are welcome to add this to your examples in your Library files. :)

Updated to v1.02: Fixed to use the whole strip of 60 leds again.
Things I've Made Here:
1.[101-Help]~12v -> 5v 1.5A Regulated Power For NeoPixels.: http://goo.gl/uMXuk7
2.[Example]NeoPixel Strip Scrolling Cylon Eye!: http://goo.gl/4RzWQQ
User avatar
EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm
Location: Canada

Re: [Example]NeoPixel Strip Scrolling Cylon Eye!

by EternalCore on Fri Aug 02, 2013 5:46 pm

Updated to v1.03: Minor Setting fixes to speed up the performance.
Things I've Made Here:
1.[101-Help]~12v -> 5v 1.5A Regulated Power For NeoPixels.: http://goo.gl/uMXuk7
2.[Example]NeoPixel Strip Scrolling Cylon Eye!: http://goo.gl/4RzWQQ
User avatar
EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm
Location: Canada

Re: [Example]NeoPixel Strip Scrolling Cylon Eye!

by EternalCore on Fri Aug 02, 2013 11:37 pm

Things I've Made Here:
1.[101-Help]~12v -> 5v 1.5A Regulated Power For NeoPixels.: http://goo.gl/uMXuk7
2.[Example]NeoPixel Strip Scrolling Cylon Eye!: http://goo.gl/4RzWQQ
User avatar
EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm
Location: Canada

Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!

by ohararp on Tue Aug 13, 2013 4:56 pm

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.
Regards Ryan,
www.ohararp.com
ohararp
 
Posts: 12
Joined: Sun Aug 27, 2006 9:59 am

Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!

by EternalCore on Tue Aug 13, 2013 7:12 pm

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.

Nice! :D
For the 1x8 bar you can just comment out these lines so it only uses 3leds:
For Scan Up:
Code: Select all | TOGGLE FULL SIZE
    //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

For Scan Down:
Code: Select all | TOGGLE FULL SIZE
    //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


That way it looks better on a smaller bar. I will be coding it in later though so keep checking back for updates.
Things I've Made Here:
1.[101-Help]~12v -> 5v 1.5A Regulated Power For NeoPixels.: http://goo.gl/uMXuk7
2.[Example]NeoPixel Strip Scrolling Cylon Eye!: http://goo.gl/4RzWQQ
User avatar
EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm
Location: Canada

Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!

by gozeeta on Mon Aug 26, 2013 12:42 am

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?
gozeeta
 
Posts: 2
Joined: Mon Aug 26, 2013 12:33 am

Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!

by EternalCore on Mon Aug 26, 2013 2:00 am

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?

Yes by Changing the number on this line in the code:
Code: Select all | TOGGLE FULL SIZE
int wait_T=40; //This is the delay between moving back and forth and per pixel
Things I've Made Here:
1.[101-Help]~12v -> 5v 1.5A Regulated Power For NeoPixels.: http://goo.gl/uMXuk7
2.[Example]NeoPixel Strip Scrolling Cylon Eye!: http://goo.gl/4RzWQQ
User avatar
EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm
Location: Canada

Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!

by gozeeta on Thu Aug 29, 2013 5:31 am

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:

Code: Select all | TOGGLE FULL SIZE
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);

  }
}

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...
gozeeta
 
Posts: 2
Joined: Mon Aug 26, 2013 12:33 am

Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!

by EternalCore on Thu Aug 29, 2013 5:37 pm

gozeeta 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:

Code: Select all | TOGGLE FULL SIZE
-snip-

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...

Here you go I added a new script just for you, for what you are trying to do: https://github.com/EternalCore/NeoPixel ... OneWay.ino :)
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
Things I've Made Here:
1.[101-Help]~12v -> 5v 1.5A Regulated Power For NeoPixels.: http://goo.gl/uMXuk7
2.[Example]NeoPixel Strip Scrolling Cylon Eye!: http://goo.gl/4RzWQQ
User avatar
EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm
Location: Canada

Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!

by mordecai131 on Thu Sep 19, 2013 1:52 am

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.
mordecai131
 
Posts: 12
Joined: Thu Sep 19, 2013 1:49 am

Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!

by EternalCore on Thu Sep 19, 2013 2:11 am

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.

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. :)
Things I've Made Here:
1.[101-Help]~12v -> 5v 1.5A Regulated Power For NeoPixels.: http://goo.gl/uMXuk7
2.[Example]NeoPixel Strip Scrolling Cylon Eye!: http://goo.gl/4RzWQQ
User avatar
EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm
Location: Canada

Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!

by EternalCore on Thu Sep 19, 2013 2:55 am

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).
Things I've Made Here:
1.[101-Help]~12v -> 5v 1.5A Regulated Power For NeoPixels.: http://goo.gl/uMXuk7
2.[Example]NeoPixel Strip Scrolling Cylon Eye!: http://goo.gl/4RzWQQ
User avatar
EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm
Location: Canada

Re: [Example]NeoPixel Strip Scrolling Cylon Eye! NOW WITH VIDEO!!!

by mordecai131 on Thu Sep 19, 2013 3:23 am

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.
mordecai131
 
Posts: 12
Joined: Thu Sep 19, 2013 1:49 am