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

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm

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

Post by EternalCore »

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.

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: [Example]NeoPixel Strip Scrolling Cylon Eye!

Post by adafruit_support_bill »

Cool :D Thanks for posting!

EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm

Re: [Example]NeoPixel Strip Scrolling Cylon Eye!

Post by EternalCore »

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.

EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm

Re: [Example]NeoPixel Strip Scrolling Cylon Eye!

Post by EternalCore »

Updated to v1.03: Minor Setting fixes to speed up the performance.

EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm

Re: [Example]NeoPixel Strip Scrolling Cylon Eye!

Post by EternalCore »


User avatar
ohararp
 
Posts: 12
Joined: Sun Aug 27, 2006 9:59 am

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

Post by ohararp »

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.

EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm

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

Post by EternalCore »

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

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

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

gozeeta
 
Posts: 2
Joined: Mon Aug 26, 2013 12:33 am

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

Post by gozeeta »

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?

EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm

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

Post by EternalCore »

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

int wait_T=40; //This is the delay between moving back and forth and per pixel

gozeeta
 
Posts: 2
Joined: Mon Aug 26, 2013 12:33 am

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

Post by gozeeta »

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

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

EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm

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

Post by EternalCore »

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

-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

User avatar
mordecai131
 
Posts: 14
Joined: Thu Sep 19, 2013 1:49 am

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

Post by mordecai131 »

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.

EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm

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

Post by EternalCore »

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

EternalCore
 
Posts: 239
Joined: Tue Jul 30, 2013 3:57 pm

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

Post by EternalCore »

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

User avatar
mordecai131
 
Posts: 14
Joined: Thu Sep 19, 2013 1:49 am

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

Post by mordecai131 »

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”