NeoPixel color groups

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.
Locked
User avatar
MartijnT
 
Posts: 2
Joined: Sun May 20, 2018 7:25 am

NeoPixel color groups

Post by MartijnT »

Hello there!

I am currently working on my final assessments together with a study partner.
We are trying to figure out how we can make NeoPixels 'breathe' while having them all soldered in a row.
For now we are only building a 'proof of concept' meaning we are currently working on our maquette.

Seeing as we aren't really technical when it comes to using Arduino we hope there is someone out there that could help us out.

Our project is about visualising movement / life at cultural hotspots (museums, concert halls and so on).
We have separated different types of culture, leading to five different colours (Purple, Green, Blue, Red and Yellow/Orange)

Currently we got all the lights 'breathing' at the same time where we would ideally love to have each individual light breathe in a slightly staggered manner (not all at the same time).
The strange thing aswell is when we have got the lights breathing at the same time in the current code, Yellow / Orange turns to red.
Also we seem to be unable to have all the lights breathe and have the text 'this is culture' as a solid white color as it will only breathe along with the text or turn off all together.

Added will be some pictures of the setup and the main code currently running.

We really hope there is someone out there able to help us out!

Thanks in advance!

Martijn

Code: Select all

// put your setup code here, to run once:

#include <Adafruit_NeoPixel.h>

#define PIN 6


// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)
//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(26, PIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel neo = Adafruit_NeoPixel(26, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  strip.begin();  
  strip.setBrightness(255);  // Lower brightness and save eyeballs!
  strip.show(); // Initialize all pixels to 'off'

}
void culture() {

  neo.begin();  
  neo.setBrightness(255);  // Lower brightness and save eyeballs!
  neo.show(); // Initialize all pixels to 'off
  neo.setPixelColor(22, 255, 255, 255); //TEXT / White
  neo.show();
  neo.setPixelColor(23, 255, 255, 255); //TEXT / White
  neo.show();
  neo.setPixelColor(24, 255, 255, 255); //TEXT / White
  neo.show();
  neo.setPixelColor(25, 255, 255, 255); //TEXT / White
  neo.show();
  


  
}
void loop() {
// put your main code here, to run repeatedly:
a
for (int i=10; i<255; i++) {
  strip.setBrightness(i); strip.show(); delay(5); } //breathe


for (int i=255; i>10; i--) {
  strip.setBrightness(i); strip.show(); delay(8); } //breathe


strip.setPixelColor(0, 255, 0 , 255); //PopEI / Purple
strip.show();
strip.setPixelColor(1, 0, 255, 0); //Area 51 / Green
strip.show();
strip.setPixelColor(2, 0, 0, 255); //NatLab / Blue
strip.show();
strip.setPixelColor(3, 0, 0, 255); //MU / Blue
strip.show();
strip.setPixelColor(4, 255, 0, 25); //De Ontdekfabriek / Red
strip.show();
strip.setPixelColor(5, 255, 0, 255); //Carte Blanche / Purple
strip.show();
strip.setPixelColor(6, 255, 0, 25); //CKE / Red
strip.show();
strip.setPixelColor(7, 255, 0, 255); //Stroomhuis / Purple
strip.show();
strip.setPixelColor(8, 0, 0, 255); //Zwarte Doos / Blue
strip.show();
strip.setPixelColor(9, 255, 135, 0); //Van Piere / Yellow
strip.show();
strip.setPixelColor(10, 255, 0, 255); //Muziekgebouw / Purple
strip.show();
strip.setPixelColor(11, 255, 0, 255); //Effenaar / Purple
strip.show();
strip.setPixelColor(12, 255, 0, 255); //Afslag Eindhoven / Purple
strip.show();
strip.setPixelColor(13, 255, 135, 0); //DAF Museum / Yellow
strip.show();
strip.setPixelColor(14, 255, 0, 255); //Dynamo / Purple
strip.show();
strip.setPixelColor(15, 0, 0, 255); //Van Abbemuseum / Blue
strip.show();
strip.setPixelColor(16, 255, 0, 255); //Parktheater / Purple
strip.show();
strip.setPixelColor(17, 255, 0, 25); //Prehistorisch Dorp / Red
strip.show();
strip.setPixelColor(18, 0, 0, 255); //De Kazerne / Blue
strip.show();
strip.setPixelColor(19, 255, 20, 0); //Philips Museum / Yellow
strip.show();
strip.setPixelColor(20, 255, 135, 0); //Bibliotheek Eindhoven / Yellow
strip.show();
strip.setPixelColor(21, 255, 135, 0); //Onomatopee / Yellow
strip.show();
}

Attachments
The soldered neopixels, the arduino connection and the front.
The soldered neopixels, the arduino connection and the front.
comp.jpg (889.16 KiB) Viewed 227 times

User avatar
kcl1s
 
Posts: 1512
Joined: Tue Aug 30, 2016 12:06 pm

Re: NeoPixel color groups

Post by kcl1s »

A couple things I see in the code you posted.

First the user function void culture() is never called in your code. I would just make those lines part of void setup().

Another problem is you are using setbrightness for animation. See my post in this thread as to why this is not advisable.viewtopic.php?%20If=47&t=135017&hilit=+setbrightness I also show the correct way to change color intensity of the pixels using a little math.


Fellow Hobbyist
Keith

User avatar
kcl1s
 
Posts: 1512
Joined: Tue Aug 30, 2016 12:06 pm

Re: NeoPixel color groups

Post by kcl1s »

I just noticed that you have 2 Neopixel objects strip and neo but you have them all wired to pin 6. That will not work. Just make them all part of the strip object by replacing the neo.setPixelColor(22, 255, 255, 255); //TEXT / White with strip.setPixelColor(22, 255, 255, 255); //TEXT / White and delete any lines to initialize the neo object.

Keith

User avatar
MartijnT
 
Posts: 2
Joined: Sun May 20, 2018 7:25 am

Re: NeoPixel color groups

Post by MartijnT »

kcl1s wrote:I just noticed that you have 2 Neopixel objects strip and neo but you have them all wired to pin 6. That will not work. Just make them all part of the strip object by replacing the neo.setPixelColor(22, 255, 255, 255); //TEXT / White with strip.setPixelColor(22, 255, 255, 255); //TEXT / White and delete any lines to initialize the neo object.

Keith
Hey there Keith!

Thanks for your reply on the problem!
We will try your feedback out tomorrow as soon as we get back to college.

Keeping you posted!

Martijn

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

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