release candidate 0.9
This commit is contained in:
parent
907cd7b6ab
commit
a01de637dc
@ -30,10 +30,10 @@
|
||||
#define SERIAL_BAUD 115200
|
||||
|
||||
//#define RGBW
|
||||
bool singleSecond = true; //show seconds
|
||||
bool allDotsOn = true; //lighten up all leds
|
||||
bool followingHour = true; //move hour like an analog one
|
||||
int volatile hourOffset = 0;
|
||||
volatile bool singleSecond = true; //show seconds
|
||||
volatile bool allDotsOn = true; //lighten up all leds
|
||||
volatile bool followingHour = true; //move hour like an analog one
|
||||
volatile int hourOffset = 0;
|
||||
|
||||
void bootAnimCallback();
|
||||
void clockTickCallback();
|
||||
@ -50,7 +50,7 @@ RgbwColor red(colorSaturation, 0, 0, 0);
|
||||
RgbwColor green(0, colorSaturation, 0, 0);
|
||||
RgbwColor blue(0, 0, colorSaturation, 0);
|
||||
RgbwColor realWhite(colorSaturation);
|
||||
RgbColor white(0, 0, 0, 40); //darkish dirt
|
||||
RgbwColor white(0, 0, 0, 40); //darkish dirt
|
||||
RgbwColor whiter(0, 0, 0, 120); //darkish dirt
|
||||
RgbwColor white12(0, 0, 0, 192); //darkish dirt
|
||||
RgbwColor black(0);
|
||||
@ -91,7 +91,7 @@ volatile int currentHour = 2;
|
||||
|
||||
// variable for storing the potentiometer value
|
||||
volatile unsigned int ldrValue = 0;
|
||||
int MAX_BRIGHTNESS = 200;
|
||||
volatile int MAX_BRIGHTNESS = 200;
|
||||
|
||||
// WebPortal
|
||||
const char thingName[] = "NTP-Clock-RGBLED";
|
||||
@ -127,7 +127,7 @@ char allDotsOnParamValue[STRING_LEN];
|
||||
char followingHourParamValue[STRING_LEN];
|
||||
|
||||
IotWebConf iotWebConf(thingName, &dnsServer, &server, wifiInitialApPassword, CONFIG_VERSION);
|
||||
IotWebConfParameterGroup timeGroup = IotWebConfParameterGroup("Time", "Time Settings");
|
||||
IotWebConfParameterGroup timeGroup = IotWebConfParameterGroup("Time", "Time settings");
|
||||
IotWebConfTextParameter ntpServerParam = IotWebConfTextParameter("NTP Server", "ntpServer", ntpServerParamValue, STRING_LEN, "pool.ntp.org");
|
||||
IotWebConfParameterGroup ledGroup = IotWebConfParameterGroup("LED", "LED settings");
|
||||
IotWebConfNumberParameter maxBrightnessParam = IotWebConfNumberParameter("Max BRIGHTNESS", "max brightness", maxBrightnessParamValue, NUMBER_LEN, "200", "20..254", "min='20' max='254' step='1'");
|
||||
@ -271,8 +271,12 @@ void iotWebConf_Setup() {
|
||||
iotWebConf.setFormValidator(&iotWebConfFormValidator);
|
||||
iotWebConf.getApTimeoutParameter()->visible = true;
|
||||
iotWebConf.setupUpdateServer(
|
||||
[](const char* updatePath) { httpUpdater.setup(&server, updatePath); },
|
||||
[](const char* userName, char* password) { httpUpdater.updateCredentials(userName, password); });
|
||||
[](const char* updatePath) {
|
||||
httpUpdater.setup(&server, updatePath);
|
||||
},
|
||||
[](const char* userName, char* password) {
|
||||
httpUpdater.updateCredentials(userName, password);
|
||||
});
|
||||
|
||||
iotWebConf.setHtmlFormatProvider(&customHtmlFormatProvider);
|
||||
// -- Initializing the configuration.
|
||||
@ -315,6 +319,8 @@ void setup() {
|
||||
Serial.print("\n\n\nCPU Frequency is: ");
|
||||
Serial.print(getCpuFrequencyMhz()); //Get CPU clock
|
||||
Serial.println(" Mhz");
|
||||
Serial.print("MAC address: ");
|
||||
Serial.println(WiFi.macAddress()); //Get CPU clock
|
||||
|
||||
Serial.println("-----------------------\nSettings\n-----------------------");
|
||||
Serial.printf("Show single second: \t%s\n", singleSecond ? "yes" : "no");
|
||||
@ -399,9 +405,22 @@ void bootAnimCallback() {
|
||||
if (currentSec < 0) {
|
||||
currentSec = 59;
|
||||
}
|
||||
if (iotWebConf.getState() == 3) {
|
||||
strip.SetPixelColor(MOD((currentSec - 0), NUM_LEDS), white);
|
||||
strip.SetPixelColor(MOD((currentSec - 1), NUM_LEDS), whiter);
|
||||
strip.SetPixelColor(MOD((currentSec - 2), NUM_LEDS), white12);
|
||||
}
|
||||
if (iotWebConf.getState() == 2) {
|
||||
strip.SetPixelColor(MOD((currentSec - 0), NUM_LEDS), orange);
|
||||
strip.SetPixelColor(MOD((currentSec - 1), NUM_LEDS), orangered);
|
||||
strip.SetPixelColor(MOD((currentSec - 2), NUM_LEDS), red);
|
||||
}
|
||||
if (iotWebConf.getState() == 0 || iotWebConf.getState() == 1) {
|
||||
strip.SetPixelColor(MOD((currentSec - 0), NUM_LEDS), orangered);
|
||||
strip.SetPixelColor(MOD((currentSec - 1), NUM_LEDS), red);
|
||||
strip.SetPixelColor(MOD((currentSec - 2), NUM_LEDS), darkred);
|
||||
}
|
||||
|
||||
strip.Show();
|
||||
}
|
||||
|
||||
@ -417,7 +436,7 @@ void brightnessAdjustmentCallback() {
|
||||
x = int(MINIMAL_BRIGHTNESS + (MAX_BRIGHTNESS - MINIMAL_BRIGHTNESS) / ((ldrValue / LDR_SCALE) + 1) );
|
||||
strip.SetBrightness(x);
|
||||
}
|
||||
//Serial.println("Brightness: " + String(strip.GetBrightness()) + "(" + String(ldrValue) + ")");
|
||||
Serial.println("Brightness: " + String(strip.GetBrightness()) + "(" + String(ldrValue) + ")");
|
||||
ldrValue = 0;
|
||||
strip.Show();
|
||||
}
|
||||
|
BIN
60LED_WS2812B_NTP_Clock.ino.lolin32.bin
Normal file
BIN
60LED_WS2812B_NTP_Clock.ino.lolin32.bin
Normal file
Binary file not shown.
26
README.md
26
README.md
@ -9,18 +9,37 @@ Sobald die Uhr mit Strom versorgt wird ( 5V, 500mAh) bietet das Board (Lolin32li
|
||||
- maximale Helligkeit
|
||||
- Anzeige der einzelnen Sekunden
|
||||
- Aufleuchten aller LEDs
|
||||
- Folgende Stunde wie auf einer analogen Uhr
|
||||
- Folgende Stunde (wie auf einer analogen Uhr)
|
||||
|
||||
Unten auf der Statusseite gibt es einen Link zur Konfigurationsseite, eine Möglichkeit für den Upload einer neuen Firmware sowie die aktuelle Firmwareversion.
|
||||
|
||||
Unten auf der Statusseite gibt es einen Link zur Konfigurationsseite
|
||||
## technische Details
|
||||
|
||||
- ESP32 (Lolin32 Lite)
|
||||
- SK6812 or WS2812B 60 LED ring
|
||||
- LDR over Resistor voltage divider
|
||||
- LED ring powered over 3.3V (WS2812B) rail or USB VCC (SK6812)
|
||||
- LED Output Pin 17 (requirement for NeoPixel library as I2C is used)
|
||||
- LED Output Pin 17 (requirement for NeoPixel library as I2S is used)
|
||||
- LDR analog measure pin A6
|
||||
|
||||
## Konfigurationsseite
|
||||
|
||||
# System configuration
|
||||
- Thing name
|
||||
- AP password
|
||||
- WiFi SSID
|
||||
- WiFi password
|
||||
- Startup delay (seconds)
|
||||
# Time settings
|
||||
- NTP server
|
||||
# LED settings
|
||||
- MAX Brightness
|
||||
- Show Seconds
|
||||
- all Dots lighten up
|
||||
- following Hour
|
||||
|
||||
- firmware update link
|
||||
- Firmware config version 'xxxx'
|
||||
|
||||
## ausstehende Verbesserungen
|
||||
- [ ] RGB Auswahl Sekunden
|
||||
@ -28,4 +47,3 @@ Unten auf der Statusseite gibt es einen Link zur Konfigurationsseite
|
||||
- [ ] RGB Auswahl Stunden
|
||||
- [ ] RGB Auswahl 12 Uhr
|
||||
- [ ] flüssige Helligkeitsadaptierung
|
||||
- [ ] Firmware Update über Upload
|
||||
|
Loading…
Reference in New Issue
Block a user