My code gives no errors, but somehow doesn't do anything?

Hi everyone, i'm working on a school project. Take in mind i'm kind of amateur in C++ well the thing right now is i've got the code for most part good but somehow it still does not work.

#include <Adafruit_NeoPixel.h>
#define Pixelpin 7 // Digital IO pin connected to the NeoPixels.
#define Numpixels 72
#define colorWipe
// Parameter 1 = number of pixels in strip, neopixel stick has 8
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_RGB Pixels are wired for RGB bitstream
// NEO_GRB Pixels are wired for GRB bitstream, correct for neopixel stick
// NEO_KHZ400 400 KHz bitstream (e.g. FLORA pixels)
// NEO_KHZ800 800 KHz bitstream (e.g. High Density LED strip), correct for neopixel stick
Adafruit_NeoPixel Ledstrip = Adafruit_NeoPixel(Numpixels, Pixelpin, NEO_GRB + NEO_KHZ800);
// Dit is nodig om de Ledstrip functies aan te zetten.



void setup() {
 Ledstrip.begin();
 Ledstrip.show(); // Initialize all pixels to 'off'
 Serial.begin(9600);
}
void loop() {//Er worden allerlei routines achter elkaar aangeroepen.
 Ledstrip.setBrightness(32); // Op Brightness 255 gaat de 9 V batterij érg snel leeg....
 Serial.println("Alles uit");
 colorWipe(Ledstrip.Color(0, 0, 0), 50); // Black, alles uit. 100 msec lang 
 Serial.println("Rood, Groen, Blauw en wit looplicht. Led's blijven aan");
 colorWipe(Ledstrip.Color(255, 0, 0), 50); // Red lopend lichtje, ledjes blijven achtereenvolgens aan.
 colorWipe(Ledstrip.Color(0, 255, 0), 50); // Green lopend lichtje, ledjes blijven achtereenvolgens aan.
 colorWipe(Ledstrip.Color(0, 0, 255), 50); // Blue lopend lichtje, ledjes blijven achtereenvolgens aan.
 colorWipe(Ledstrip.Color(255, 255, 255), 50); // White lopend lichtje, ledjes blijven achtereenvolgens aan. 
}

And this is my image of my project template/setup

Any suggestions why it isn't doing anything?

Thanks in advance.

  • Jaouad

Try one of the examples that comes with the library.


Use CTRL T to format your code.
Attach your ‘complete’ sketch between code tags, use the </> icon in the posting menu.
[code]Paste your sketch here[/code]


Where is:

 // Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }

I saw my mistake in the setup, i fixed that. and i already had the void colorwipe but got rid of it because it seems just to keep on telling me to add a ) before c. And without it it isn't really doing anything .

quick edit:

it says for

void colorWipe(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }

error = 15:25: error: expected ')' before 'c'

Update: I got it to work, somehow. Thanks for the help.