NimmLor / esp8266-fastled-desk-light

this repo has moved, https://github.com/NimmLor/esp8266-fastled-iot-webserver
GNU General Public License v3.0
25 stars 11 forks source link

Erros compiling without alexa enable #10

Open goncalorijo opened 4 years ago

goncalorijo commented 4 years ago

Hello,

I've printed and assembled all the parte. It is working with the FASTLED demos. Now I want to install this but I'm getting the following error:

esp8266-fastled-desk-light:464:5: error: 'alexa_main' was not declared in this scope

     alexa_main->setColor(r.toInt(),g.toInt(),b.toInt());

     ^

Here is my configuration:

/*######################## MAIN CONFIG ########################*/
#define DATA_PIN      D4          // Should be GPIO02 on other boards like the NodeMCU
#define LED_TYPE      WS2813     // You might also use a WS2811 or any other strip that is fastled compatible 
#define COLOR_ORDER   GRB         // Change this if colors are swapped (in my case, red was swapped with green)
#define MILLI_AMPS    2000        // IMPORTANT: set the max milli-Amps of your power supply (4A = 4000mA)
#define VOLTS         5           // Voltage of the Power Supply
#define LINE_COUNT    8           // Amount of led strip pieces
#define LEDS_PER_LINE 8          // Amount of led pixel per single led strip piece

const bool apMode = false;        // set to true if the esp8266 should open an access point

//#define SOUND_REACTIVE            // Uncomment to enable the Sound reactive mode
#define SOUND_SENSOR_PIN A0       // An Analog sensor should be connected to an analog pin
#define SENSOR_TYPE 0             // 0: Dumb Sensors, 1: MAX4466 Sound Sensor, 2: MAX9814 Sound Sensor

#define HOSTNAME "ESP8266 Desk Lamp"      // Name that appears in your network
#define CORRECTION UncorrectedColor       // If colors are weird use TypicalLEDStrip

//#define RANDOM_AUTOPLAY_PATTERN   // if enabled the next pattern for autoplay is choosen at random, 
                                  // if commented out patterns will play in order
//#define ENABLE_ALEXA_SUPPORT      // Espalexa library required

/*######################## MAIN CONFIG END ####################*/

Any help?

Okkupant commented 4 years ago

replace "alexa_main->setColor(r.toInt(),g.toInt(),b.toInt());" with:

ifdef ENABLE_ALEXA_SUPPORT

  alexa_main->setColor(r.toInt(),g.toInt(),b.toInt());

endif

and "alexa_main->setValue(brightness);" with:

ifdef ENABLE_ALEXA_SUPPORT

  alexa_main->setValue(brightness);

endif