Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8d6eafe8bf | ||
|
ad1f758acf | ||
|
543dd80f76 | ||
|
20dd058162 | ||
|
b4afca5630 | ||
|
fd5a5a70de | ||
|
83e7526828 | ||
|
53ba768849 | ||
|
794b36b2db |
@ -53,7 +53,7 @@ For beginners I would recommend watching this setup tutorial below.
|
||||
|
||||
## 2. Software Configuration
|
||||
|
||||
1. Download the Project from the [Releases at Github]( https://github.com/NimmLor/esp8266-fastled-desk-light/releases ) and extract the archive
|
||||
1. Download the Project from the [Releases at Github]( https://github.com/NimmLor/esp8266-nanoleaf-webserver/releases ) and extract the archive
|
||||
|
||||
2. Open the **.ino** file inside the folder in the Arduino IDE
|
||||
|
||||
@ -77,7 +77,7 @@ For beginners I would recommend watching this setup tutorial below.
|
||||
|
||||
5. Configure the parameters
|
||||
In the .ino file there are many parameters to change and tweak the essential settings are:
|
||||
- `DATA_PIN`: The pin where the LED-Strip is connected
|
||||
- `DATA_PIN`: The pin where the LED-Strip is connected (Note: If you are using another controller such as a clone or a NodeMCU board, you may need to configure the pin assignment for FastLED, See also [this entry in the FastLED Wiki](https://github.com/FastLED/FastLED/wiki/ESP8266-notes))
|
||||
|
||||
- `LED_TYPE`: The type of LED strip that is used (WS2812B, WS2811, ...)
|
||||
|
||||
@ -86,8 +86,7 @@ For beginners I would recommend watching this setup tutorial below.
|
||||
- `LEDS_PER_LINE`: Amount of LEDs inside **1x** slot of the core
|
||||
|
||||
- `SOUND_REACTIVE`: Uncomment to enable a sound reactive pattern when using a sound sensor
|
||||
|
||||
- `SENSOR_TYPE`: Model of the [Sensor](http://s.click.aliexpress.com/e/_sYiUrz) used
|
||||
- `SENSOR_TYPE`: Model of the [Sensor](http://s.click.aliexpress.com/e/_sYiUrz) used
|
||||
|
||||
- `ENABLE_ALEXA_SUPPORT`: Uncomment to disable the Amazon Alexa Support
|
||||
|
||||
|
@ -28,7 +28,7 @@ extern "C" {
|
||||
#include <EEPROM.h>
|
||||
#include "GradientPalettes.h"
|
||||
#include "Field.h"
|
||||
|
||||
#include <ESP8266mDNS.h> //Enable mDNS availability
|
||||
|
||||
|
||||
/*######################## MAIN CONFIG ########################*/
|
||||
@ -228,9 +228,7 @@ PatternAndNameList patterns = {
|
||||
{ cloud2Twinkles, "Cloud 2 Twinkles" },
|
||||
{ oceanTwinkles, "Ocean Twinkles" },
|
||||
|
||||
{ showSolidColor, "Solid Color" },
|
||||
|
||||
{ SetCustomPattern, "Custom Pattern"}
|
||||
{ showSolidColor, "Solid Color" }
|
||||
};
|
||||
|
||||
const uint8_t patternCount = ARRAY_SIZE(patterns);
|
||||
@ -488,7 +486,9 @@ void setup() {
|
||||
String g = webServer.arg("g");
|
||||
String b = webServer.arg("b");
|
||||
setSolidColor(r.toInt(), g.toInt(), b.toInt());
|
||||
#ifdef ENABLE_ALEXA_SUPPORT
|
||||
alexa_main->setColor(r.toInt(), g.toInt(), b.toInt());
|
||||
#endif
|
||||
sendString(String(solidColor.r) + "," + String(solidColor.g) + "," + String(solidColor.b));
|
||||
});
|
||||
|
||||
@ -519,7 +519,9 @@ void setup() {
|
||||
webServer.on("/brightness", HTTP_POST, []() {
|
||||
String value = webServer.arg("value");
|
||||
setBrightness(value.toInt());
|
||||
#ifdef ENABLE_ALEXA_SUPPORT
|
||||
alexa_main->setValue(brightness);
|
||||
#endif
|
||||
sendInt(brightness);
|
||||
});
|
||||
|
||||
@ -614,13 +616,17 @@ void broadcastString(String name, String value)
|
||||
}
|
||||
|
||||
void loop() {
|
||||
MDNS.update();
|
||||
// Add entropy to random number generator; we use a lot of it.
|
||||
random16_add_entropy(random(65535));
|
||||
|
||||
// dnsServer.processNextRequest();
|
||||
// webSocketsServer.loop();
|
||||
#ifdef ENABLE_ALEXA_SUPPORT
|
||||
espalexa.loop();
|
||||
#else
|
||||
webServer.handleClient();
|
||||
|
||||
#endif
|
||||
// handleIrInput();
|
||||
|
||||
if (power == 0) {
|
||||
@ -640,7 +646,13 @@ void loop() {
|
||||
hasConnected = true;
|
||||
Serial.print("Connected! Open http://");
|
||||
Serial.print(WiFi.localIP());
|
||||
Serial.println(" in your browser");
|
||||
Serial.println(" in your browser \n");
|
||||
if (!MDNS.begin(HOSTNAME)) {
|
||||
Serial.println("Error setting up MDNS responder! \n");
|
||||
} else {
|
||||
Serial.println("mDNS responder started \n");
|
||||
MDNS.addService("http", "tcp", 80);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -821,7 +833,7 @@ void setSolidColor(uint8_t r, uint8_t g, uint8_t b)
|
||||
EEPROM.write(4, b);
|
||||
EEPROM.commit();
|
||||
|
||||
setPattern(29);
|
||||
setPatternName("Solid Color");
|
||||
|
||||
broadcastString("color", String(solidColor.r) + "," + String(solidColor.g) + "," + String(solidColor.b));
|
||||
FastLED.show();
|
||||
|
Loading…
x
Reference in New Issue
Block a user