Led Desk 2.0 Help!

Hello everyone I’m new here and would really like if someone could help me out.
I’m building this project right here: http://www.instructables.com/id/LED-Glass-Desk-v20/step4/The-Software/
So I finished the hardware soldering and mounted it to a board but I’m hitting a error in the coding.

#define WEBDUINO_FAIL_MESSAGE “NOT ok\n”
#include “SPI.h”
#include “avr/pgmspace.h”
#include “Ethernet.h”
#include “WebServer.h”
#include <Adafruit_WS2801.h>

/*** This is what you will almost certainly have to change ***/

// WEB stuff
static uint8_t mac = { 0x90, 0xA2, 0xDA, 0x0E, 0xCC, 0x0A }; // update this to match your arduino/shield
static uint8_t ip = { 192, 168, 0, 0 }; // update this to match your network

// LED Stuff
int dataPin = 2; // Yellow wire on Adafruit Pixels
int clockPin = 3; // Green wire on Adafruit Pixels
#define STRIPLEN 60
#define Adafruit_WS2801 strip = Adafruit_WS2801(STRIPLEN, dataPin, clockPin, WS2801_GRB);
int defaultPattern = 0;

// LED Grid stuff
int max_x = 11;
int max_y = 4;

// ‘graph’ style x,y where 0,0 is bottom left
int grid[STRIPLEN] = {
4,5,14,15,24,25,34,35,44,45,54,55,
3,6,13,16,23,26,33,36,43,46,53,56,
2,7,12,17,22,27,32,37,42,47,52,57,
1,8,11,18,21,28,31,38,41,48,51,58,
0,9,10,19,20,29,30,39,40,49,50,59
};

// ‘screen’ style x,y where 0,0 is top left
/*
int grid[STRIPLEN] = {
0,9,10,19,20,29,30,39,40,49,50,59,
1,8,11,18,21,28,31,38,41,48,51,58,
2,7,12,17,22,27,32,37,42,47,52,57,
3,6,13,16,23,26,33,36,43,46,53,56,
4,5,14,15,24,25,34,35,44,45,54,55
};
*/

/*** Things you might want to change ***/

// basic web auth, not super secure without https
// see example at GitHub - sirleech/Webduino: Arduino WebServer library
// use auth?
#define AUTH 0
// credentials (in base64 user:pass)
#define CRED “dXNlcjpwYXNz”

WebServer webserver("", 80); // port to listen on

// ROM-based messages for webduino lib, maybe overkill here
P(ok) = “ok\n”;
P(noauth) = “User Denied\n”;

// max length of param names and values
#define NAMELEN 2
#define VALUELEN 32

/*** Below here shouldn’t need to change ***/

void log(char * input) {
if (1) {
Serial.println(input);
}
}

// LED support functions

// create the “Color” value from rgb…This is right from Adafruit
uint32_t Color(byte r, byte g, byte b) {
uint32_t c;
c = r;
c <<= 8;
c |= g;
c <<= 8;
c |= b;
return c;
}

// create a “Color” value from a hex string (no prefix)
// for example: ffffff
uint32_t hexColor(char * in) {
return strtol(in, NULL, 16);
}

//Input a value 0 to 255 to get a color value.
//The colours are a transition r - g -b - back to r
uint32_t Wheel(byte WheelPos) {
if (WheelPos < 85) {
return Color(WheelPos * 3, 255 - WheelPos * 3, 0);
} else if (WheelPos < 170) {
WheelPos -= 85;
return Color(255 - WheelPos * 3, 0, WheelPos * 3);
} else {
WheelPos -= 170;
return Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
}

// set all pixels to a “Color” value
void colorAll(uint32_t c) {
for (int i=0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, c);
}
strip.show();
}

// set all pixels to a “Color” value, one at a time, with a delay
void colorWipe(uint32_t c, uint8_t wait) {
for (int i=0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}

// fade from one color to another: UNFINISHED
void fade(uint32_t c1, uint32_t c2, int wait) {
if (c1 < c2) {
while (c1 < c2) {
colorAll(c1++);
delay(wait);
}
} else {
while (c1 > c2) {
colorAll(c1–);
delay(wait);
}
}
}
------------to much code for post----------------------------

I keep getting error where the bold is it says “string not defined in this scope”
I’ve been messing with this code for a while and would greatly appreciate any help I can get.
Thanks Anthony.

It is a pity that you did not post all of your code, and what you did post is in quote rather than code tags.

If the code is too big to post you can attach it. See Additional Options when in the message editor.

There i think i uploaded it right
sorry fir doing that :~

DeskLights2.ino (12.9 KB)

You seem to have attached it OK but I don’t have all the libraries or hardware so can’t test it.

“string not defined in this scope”

Is that exactly what the error message says ?

Yes that is the exact error message

Where did you initialize strip, what / where is it located? Is it part of a library, if so which one? The reason you are getting that message is because it is the first occurrence of strip.numPixels(). If your code does not know what strip is, then the compiler will assume it is a string, until proved otherwise.

so its a library error? If so all i need to do is figure out which one right?
Thanks Anthony

Here is your problem.

#define Adafruit_WS2801 strip = Adafruit_WS2801(STRIPLEN, dataPin, clockPin, WS2801_GRB);

Your defining Adafruit_WS2801 with strip = Adafruit_WS2801(STRIPLEN, dataPin, clockPin, WS2801_GRB); but nowhere else do you use Adafruit_WS2801. Also what are dataPin and clockPin set to?

What might help is remove #define and just leave the rest as is, and also tell it what dataPin and clockPin are.

or maybe you’re just missing a ?

#define Adafruit_WS2801 // two lines?
strip = Adafruit_WS2801(STRIPLEN, dataPin, clockPin, WS2801_GRB);

No, that doesn’t make any sense.
Why would he need to move it to another line? If he did that, then why define it at all?

He needs to look at an example sketch to show him how to write the code the correct way. Or he could get rid of the #define.

Actually here is the example sketch.

 #include "SPI.h"
#include "Adafruit_WS2801.h"

/*****************************************************************************
Example sketch for driving Adafruit WS2801 pixels!


  Designed specifically to work with the Adafruit RGB Pixels!
  12mm Bullet shape ----> https://www.adafruit.com/products/322
  12mm Flat shape   ----> https://www.adafruit.com/products/738
  36mm Square shape ----> https://www.adafruit.com/products/683

  These pixels use SPI to transmit the color data, and have built in
  high speed PWM drivers for 24 bit color per pixel
  2 pins are required to interface

  Adafruit invests time and resources providing this open source code, 
  please support Adafruit and open-source hardware by purchasing 
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.  
  BSD license, all text above must be included in any redistribution

*****************************************************************************/

// Choose which 2 pins you will use for output.
// Can be any valid output pins.
// The colors of the wires may be totally different so
// BE SURE TO CHECK YOUR PIXELS TO SEE WHICH WIRES TO USE!
uint8_t dataPin  = 2;    // Yellow wire on Adafruit Pixels
uint8_t clockPin = 3;    // Green wire on Adafruit Pixels

// Don't forget to connect the ground wire to Arduino ground,
// and the +5V wire to a +5V supply

// Set the first variable to the NUMBER of pixels. 25 = 25 pixels in a row
Adafruit_WS2801 strip = Adafruit_WS2801(25, dataPin, clockPin);

// Optional: leave off pin numbers to use hardware SPI
// (pinout is then specific to each board and can't be changed)
//Adafruit_WS2801 strip = Adafruit_WS2801(25);

// For 36mm LED pixels: these pixels internally represent color in a
// different format.  Either of the above constructors can accept an
// optional extra parameter: WS2801_RGB is 'conventional' RGB order
// WS2801_GRB is the GRB order required by the 36mm pixels.  Other
// than this parameter, your code does not need to do anything different;
// the library will handle the format change.  Examples:
//Adafruit_WS2801 strip = Adafruit_WS2801(25, dataPin, clockPin, WS2801_GRB);
//Adafruit_WS2801 strip = Adafruit_WS2801(25, WS2801_GRB);

void setup() {
    
  strip.begin();

  // Update LED contents, to start they are all 'off'
  strip.show();
}


void loop() {
  // Some example procedures showing how to display to the pixels
  
  colorWipe(Color(255, 0, 0), 50);
  colorWipe(Color(0, 255, 0), 50);
  colorWipe(Color(0, 0, 255), 50);
  rainbow(20);
  rainbowCycle(20);
}

void rainbow(uint8_t wait) {
  int i, j;
   
  for (j=0; j < 256; j++) {     // 3 cycles of all 256 colors in the wheel
    for (i=0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel( (i + j) % 255));
    }  
    strip.show();   // write all the pixels out
    delay(wait);
  }
}

// Slightly different, this one makes the rainbow wheel equally distributed 
// along the chain
void rainbowCycle(uint8_t wait) {
  int i, j;
  
  for (j=0; j < 256 * 5; j++) {     // 5 cycles of all 25 colors in the wheel
    for (i=0; i < strip.numPixels(); i++) {
      // tricky math! we use each pixel as a fraction of the full 96-color wheel
      // (thats the i / strip.numPixels() part)
      // Then add in j which makes the colors go around per pixel
      // the % 96 is to make the wheel cycle around
      strip.setPixelColor(i, Wheel( ((i * 256 / strip.numPixels()) + j) % 256) );
    }  
    strip.show();   // write all the pixels out
    delay(wait);
  }
}

// fill the dots one after the other with said color
// good for testing purposes
void colorWipe(uint32_t c, uint8_t wait) {
  int i;
  
  for (i=0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }
}

/* Helper functions */

// Create a 24 bit color value from R,G,B
uint32_t Color(byte r, byte g, byte b)
{
  uint32_t c;
  c = r;
  c <<= 8;
  c |= g;
  c <<= 8;
  c |= b;
  return c;
}

//Input a value 0 to 255 to get a color value.
//The colours are a transition r - g -b - back to r
uint32_t Wheel(byte WheelPos)
{
  if (WheelPos < 85) {
   return Color(WheelPos * 3, 255 - WheelPos * 3, 0);
  } else if (WheelPos < 170) {
   WheelPos -= 85;
   return Color(255 - WheelPos * 3, 0, WheelPos * 3);
  } else {
   WheelPos -= 170; 
   return Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
}

// Don’t forget to connect the ground wire to Arduino ground,
// and the +5V wire to a +5V supply

// Set the first variable to the NUMBER of pixels. 25 = 25 pixels in a row
Adafruit_WS2801 strip = Adafruit_WS2801(25, dataPin, clockPin);

// Optional: leave off pin numbers to use hardware SPI
// (pinout is then specific to each board and can’t be changed)
//Adafruit_WS2801 strip = Adafruit_WS2801(25);

The pins are set to pin 2 is the data pin and 3 is the clock pin . So I need to get rid of the #define ? Because when i do this i get a error "call of overloaded 'Adafruit_WS2801(int,int&,int)'"

That's because you are inputting one too many elements. Look at the sketch I provided and find the one I put in Bold. Does it look like yours. Also if you want, take a look at the .h file and see all the possible elements you can have in that function.

I will do that thanks a lot ill update if i get it working