Skip to content

Commit 7a72a4f

Browse files
committed
Now writing IP address to serial monitor after connected. Some cleanup.
1 parent 8b8cbbf commit 7a72a4f

File tree

4 files changed

+5
-50
lines changed

4 files changed

+5
-50
lines changed

esp32-fastled-webserver.ino

-2
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ void loop()
230230
// Call the current pattern function once, updating the 'leds' array
231231
patterns[currentPatternIndex].pattern();
232232

233-
// do some periodic updates
234233
EVERY_N_MILLISECONDS(40) {
235234
// slowly blend the current palette to the next
236235
nblendPaletteTowardPalette(currentPalette, targetPalette, 8);
@@ -268,4 +267,3 @@ void nextPalette()
268267
targetPalette = palettes[currentPaletteIndex];
269268
}
270269

271-

gradientPalettes.h

-46
Original file line numberDiff line numberDiff line change
@@ -465,49 +465,3 @@ DEFINE_GRADIENT_PALETTE( Blue_Cyan_Yellow_gp ) {
465465
191, 42,255, 45,
466466
255, 255,255, 0};
467467

468-
469-
// Single array of defined cpt-city color palettes.
470-
// This will let us programmatically choose one based on
471-
// a number, rather than having to activate each explicitly
472-
// by name every time.
473-
// Since it is const, this array could also be moved
474-
// into PROGMEM to save SRAM, but for simplicity of illustration
475-
// we'll keep it in a regular SRAM array.
476-
//
477-
// This list of color palettes acts as a "playlist"; you can
478-
// add or delete, or re-arrange as you wish.
479-
const TProgmemRGBGradientPalettePtr gGradientPalettes[] = {
480-
Sunset_Real_gp,
481-
es_rivendell_15_gp,
482-
es_ocean_breeze_036_gp,
483-
rgi_15_gp,
484-
retro2_16_gp,
485-
Analogous_1_gp,
486-
es_pinksplash_08_gp,
487-
Coral_reef_gp,
488-
es_ocean_breeze_068_gp,
489-
es_pinksplash_07_gp,
490-
es_vintage_01_gp,
491-
departure_gp,
492-
es_landscape_64_gp,
493-
es_landscape_33_gp,
494-
rainbowsherbet_gp,
495-
gr65_hult_gp,
496-
gr64_hult_gp,
497-
GMT_drywet_gp,
498-
ib_jul01_gp,
499-
es_vintage_57_gp,
500-
ib15_gp,
501-
Fuschia_7_gp,
502-
es_emerald_dragon_08_gp,
503-
lava_gp,
504-
fire_gp,
505-
Colorfull_gp,
506-
Magenta_Evening_gp,
507-
Pink_Purple_gp,
508-
es_autumn_19_gp,
509-
BlacK_Blue_Magenta_White_gp,
510-
BlacK_Magenta_Red_gp,
511-
BlacK_Red_Magenta_Yellow_gp,
512-
Blue_Cyan_Yellow_gp };
513-

palettes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,4 +221,4 @@ const String paletteNames[paletteCount] = {
221221
};
222222

223223
CRGBPalette16 currentPalette( CRGB::Black);
224-
CRGBPalette16 targetPalette( gGradientPalettes[0] );
224+
CRGBPalette16 targetPalette( palettes[0] );

web.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,12 @@ void handleWeb() {
6464
// check for connection
6565
if ( WiFi.status() == WL_CONNECTED ) {
6666
if (!webServerStarted) {
67-
// turn off hte board's LED when connected to wifi
67+
// turn off the board's LED when connected to wifi
6868
digitalWrite(led, 1);
6969
Serial.println();
70+
Serial.println("WiFi connected");
71+
Serial.print("IP address: ");
72+
Serial.println(WiFi.localIP());
7073
webServerStarted = true;
7174
setupWeb();
7275
}

0 commit comments

Comments
 (0)