0

Compile Error with ws2801 arduino lib
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Compile Error with ws2801 arduino lib

by mnlagrasta on Wed Feb 06, 2013 12:27 pm

Had to move development to a new machine and install the Arduino IDE and library from scratch. Suddenly, my old code is not compiling. When I try to verify or upload the code, I get the following error:

Code: Select all | TOGGLE FULL SIZE
DeskLights2:10: error: call of overloaded 'Adafruit_WS2801(int, int&, int&, int)' is ambiguous
/Users/michael/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.h:22: note: candidates are: Adafruit_WS2801::Adafruit_WS2801(uint16_t, uint16_t, uint8_t, uint8_t, uint8_t)
/Users/michael/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.h:21: note:                 Adafruit_WS2801::Adafruit_WS2801(uint16_t, uint8_t, uint8_t, uint8_t)


If I remove the WS2801_GRB param:
Code: Select all | TOGGLE FULL SIZE
Adafruit_WS2801 strip = Adafruit_WS2801(25, dataPin, clockPin, WS2801_GRB);

so it's like this:
Code: Select all | TOGGLE FULL SIZE
Adafruit_WS2801 strip = Adafruit_WS2801(40, dataPin, clockPin);

It works fine.

However, I have the 36mm Square Pixels and those are GRB. Can anyone steer me towards my error here? Any help is greatly appreciated.

Thanks,
Mike
mnlagrasta
 
Posts: 10
Joined: Wed Apr 25, 2012 4:47 pm

Re: Compile Error with ws2801 arduino lib

by adafruit_support_bill on Thu Feb 07, 2013 8:38 am

There were some changes to the library as recently as a couple months ago. How old was your previous version of the library?
https://github.com/adafruit/Adafruit-WS2801-Library

adafruit_support_bill
 
Posts: 74058
Joined: Sat Feb 07, 2009 10:11 am

Re: Compile Error with ws2801 arduino lib

by readydestroy on Wed Mar 13, 2013 8:23 pm

I'm getting the same error. Was a solution ever found?
readydestroy
 
Posts: 2
Joined: Wed Feb 20, 2013 10:31 pm

Re: Compile Error with ws2801 arduino lib

by adafruit_support_rick on Thu Mar 14, 2013 10:31 am

If your code no longer compiles with the new libraries, you'll have to update your code to match them.

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Compile Error with ws2801 arduino lib

by readydestroy on Thu Mar 14, 2013 11:23 am

I am just trying to compile the example code with the library, strandtest. I am working with the 36mm pixels which expect GRB data not RGB. When I try to use

Adafruit_WS2801 strip = Adafruit_WS2801(25, dataPin, clockPin, WS2801_GRB);

The examples will not compile.

strandtest:49: error: call of overloaded 'Adafruit_WS2801(int, int&, int&, int)' is ambiguous
/Users/matt/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.h:22: note: candidates are: Adafruit_WS2801::Adafruit_WS2801(uint16_t, uint16_t, uint8_t, uint8_t, uint8_t)
/Users/matt/Documents/Arduino/libraries/Adafruit_WS2801/Adafruit_WS2801.h:21: note: Adafruit_WS2801::Adafruit_WS2801(uint16_t, uint8_t, uint8_t, uint8_t)
readydestroy
 
Posts: 2
Joined: Wed Feb 20, 2013 10:31 pm

Re: Compile Error with ws2801 arduino lib

by pburgess on Thu Mar 14, 2013 1:51 pm

Ah ha. This was a conspiracy bug between the example sketches and some recently contributed changes. Github's been updated, and the change is a simple two line fix in the sketch. Change the pin declarations from ints to uint8_t's:
Code: Select all | TOGGLE FULL SIZE
uint8_t dataPin  = 2;    // Yellow wire on Adafruit Pixels
uint8_t clockPin = 3;    // Green wire on Adafruit Pixels

pburgess
 
Posts: 4022
Joined: Sun Oct 26, 2008 2:29 am

Please be positive and constructive with your questions and comments.