Ah, you’re right - compiling a 2nd time worked.
Here’s what I’m trying to do in the attached diff files.
Again, I’m new at this and just trying to help development any way I can.
Here’s the compiling error’s I’m getting.
wled00\my_config.h:17:2: warning: #warning **** my_config.h: Settings from this file are honored **** [-Wcpp]
#warning **** my_config.h: Settings from this file are honored ****
^
In file included from wled00\FX.cpp:27:0:
wled00\FX.h:649:25: error: ISO C++ forbids declaration of 'mode_phoneytv' with no type [-fpermissive]
mode_phoneytv(void);
^
wled00\FX.h: In constructor 'WS2812FX::WS2812FX()':
wled00\FX.h:441:46: error: cannot convert 'int (WS2812FX::*)()' to 'WS2812FX::mode_ptr {aka short unsigned int (WS2812FX::*)()}' in assignment
_mode[FX_MODE_PHONEYTV] = &WS2812FX::mode_phoneytv;
^
In file included from wled00\wled.h:74:0,
from wled00\dmx.cpp:1:
wled00\my_config.h:17:2: warning: #warning **** my_config.h: Settings from this file are honored **** [-Wcpp]
#warning **** my_config.h: Settings from this file are honored ****
^
In file included from wled00\wled.h:74:0,
from wled00\cfg.cpp:1:
wled00\my_config.h:17:2: warning: #warning **** my_config.h: Settings from this file are honored **** [-Wcpp]
#warning **** my_config.h: Settings from this file are honored ****
^
In file included from wled00\FX_fcn.cpp:27:0:
wled00\FX.h:649:25: error: ISO C++ forbids declaration of 'mode_phoneytv' with no type [-fpermissive]
mode_phoneytv(void);
^
In file included from wled00\wled.h:74:0,
from wled00\colors.cpp:1:
wled00\my_config.h:17:2: warning: #warning **** my_config.h: Settings from this file are honored **** [-Wcpp]
#warning **** my_config.h: Settings from this file are honored ****
^
wled00\FX.h: In constructor 'WS2812FX::WS2812FX()':
wled00\FX.h:441:46: error: cannot convert 'int (WS2812FX::*)()' to 'WS2812FX::mode_ptr {aka short unsigned int (WS2812FX::*)()}' in assignment
_mode[FX_MODE_PHONEYTV] = &WS2812FX::mode_phoneytv;
^
wled00\FX.cpp: At global scope:
wled00\FX.cpp:3734:10: error: prototype for 'uint16_t WS2812FX::mode_phoneytv()' does not match any in class 'WS2812FX'
uint16_t WS2812FX::mode_phoneytv(void) {
^
In file included from wled00\FX.cpp:27:0:
wled00\FX.h:649:7: error: candidate is: int WS2812FX::mode_phoneytv()
mode_phoneytv(void);
^
wled00\FX.cpp: In function 'void isItTimeToDip(bool)':
wled00\FX.cpp:3803:3: error: 'timeToDip' was not declared in this scope
timeToDip = dipTime;
^
wled00\FX.cpp:3805:5: error: 'dipCount' was not declared in this scope
dipCount = 0;
^
wled00\FX.cpp:3806:5: error: 'dipStartTime' was not declared in this scope
dipStartTime = millis();
^
wled00\FX.cpp:3807:5: error: 'darkTime' was not declared in this scope
darkTime = random(50, 150);
^
wled00\FX.cpp:3808:5: error: 'dipInterval' was not declared in this scope
dipInterval = random(5, 250);
^
*** [.pio\build\d1_mini\src\FX_fcn.cpp.o] Error 1
*** [.pio\build\d1_mini\src\FX.cpp.o] Error 1
In file included from wled00\fcn_declare.h:97:0,
from wled00\wled.h:110,
from wled00\alexa.cpp:1:
wled00\FX.h:649:25: error: ISO C++ forbids declaration of 'mode_phoneytv' with no type [-fpermissive]
mode_phoneytv(void);
^
wled00\FX.h: In constructor 'WS2812FX::WS2812FX()':
wled00\FX.h:441:46: error: cannot convert 'int (WS2812FX::*)()' to 'WS2812FX::mode_ptr {aka short unsigned int (WS2812FX::*)()}' in assignment
_mode[FX_MODE_PHONEYTV] = &WS2812FX::mode_phoneytv;
^
In file included from wled00\fcn_declare.h:97:0,
from wled00\wled.h:110,
from wled00\button.cpp:1:
wled00\FX.h:649:25: error: ISO C++ forbids declaration of 'mode_phoneytv' with no type [-fpermissive]
mode_phoneytv(void);
^
wled00\FX.h: In constructor 'WS2812FX::WS2812FX()':
wled00\FX.h:441:46: error: cannot convert 'int (WS2812FX::*)()' to 'WS2812FX::mode_ptr {aka short unsigned int (WS2812FX::*)()}' in assignment
_mode[FX_MODE_PHONEYTV] = &WS2812FX::mode_phoneytv;
^
In file included from wled00\fcn_declare.h:97:0,
from wled00\wled.h:110,
from wled00\blynk.cpp:1:
wled00\FX.h:649:25: error: ISO C++ forbids declaration of 'mode_phoneytv' with no type [-fpermissive]
mode_phoneytv(void);
^
wled00\FX.h: In constructor 'WS2812FX::WS2812FX()':
wled00\FX.h:441:46: error: cannot convert 'int (WS2812FX::*)()' to 'WS2812FX::mode_ptr {aka short unsigned int (WS2812FX::*)()}' in assignment
_mode[FX_MODE_PHONEYTV] = &WS2812FX::mode_phoneytv;
^
In file included from wled00\fcn_declare.h:97:0,
from wled00\wled.h:110,
from wled00\dmx.cpp:1:
wled00\FX.h:649:25: error: ISO C++ forbids declaration of 'mode_phoneytv' with no type [-fpermissive]
mode_phoneytv(void);
^
wled00\FX.h: In constructor 'WS2812FX::WS2812FX()':
wled00\FX.h:441:46: error: cannot convert 'int (WS2812FX::*)()' to 'WS2812FX::mode_ptr {aka short unsigned int (WS2812FX::*)()}' in assignment
_mode[FX_MODE_PHONEYTV] = &WS2812FX::mode_phoneytv;
^
In file included from wled00\fcn_declare.h:97:0,
from wled00\wled.h:110,
from wled00\cfg.cpp:1:
wled00\FX.h:649:25: error: ISO C++ forbids declaration of 'mode_phoneytv' with no type [-fpermissive]
mode_phoneytv(void);
^
wled00\FX.h: In constructor 'WS2812FX::WS2812FX()':
wled00\FX.h:441:46: error: cannot convert 'int (WS2812FX::*)()' to 'WS2812FX::mode_ptr {aka short unsigned int (WS2812FX::*)()}' in assignment
_mode[FX_MODE_PHONEYTV] = &WS2812FX::mode_phoneytv;
^
In file included from wled00\fcn_declare.h:97:0,
from wled00\wled.h:110,
from wled00\colors.cpp:1:
wled00\FX.h:649:25: error: ISO C++ forbids declaration of 'mode_phoneytv' with no type [-fpermissive]
mode_phoneytv(void);
^
wled00\FX.h: In constructor 'WS2812FX::WS2812FX()':
wled00\FX.h:441:46: error: cannot convert 'int (WS2812FX::*)()' to 'WS2812FX::mode_ptr {aka short unsigned int (WS2812FX::*)()}' in assignment
_mode[FX_MODE_PHONEYTV] = &WS2812FX::mode_phoneytv;
^
*** [.pio\build\d1_mini\src\alexa.cpp.o] Error 1
*** [.pio\build\d1_mini\src\button.cpp.o] Error 1
*** [.pio\build\d1_mini\src\blynk.cpp.o] Error 1
*** [.pio\build\d1_mini\src\dmx.cpp.o] Error 1
*** [.pio\build\d1_mini\src\colors.cpp.o] Error 1
*** [.pio\build\d1_mini\src\cfg.cpp.o] Error 1
================================================================================================================================================ [FAILED] Took 3.70 seconds ================================================================================================================================================
I’m not able to upload files, so here’s the content of the diffs:
FX.cpp.diff.txt
--- WLED-master/wled00/FX.cpp 2020-12-03 04:22:10.000000000 -0500
+++ "WLED-master (1)/WLED-master/wled00/FX.cpp" 2020-12-04 23:01:21.633578800 -0500
@@ -3727,3 +3727,84 @@
return FRAMETIME;
}
+
+/*
+/* Simulates TV lighting effect (PhoneyTV)
+*/
+uint16_t WS2812FX::mode_phoneytv(void) {
+/*
+ * Lights up all LEDs in one random color. Then switches them
+ * to the next random color. Simulates lighting effects similar
+ * to what is seen (from outside the building) while TV is playing -- from PhoneyTV by Jim (BulldogLowell@gmail.com)
+ *
+ * Conversion from PWM analog LED control to addressable LED strip is a work-in-progress.
+ */
+
+ uint8_t twitch = 50;
+ uint8_t dipInterval = 10;
+ uint8_t darkTime = 250;
+
+ uint16_t dipCount = 0;
+
+ uint32_t currentMillis;
+ uint32_t currentDipTime;
+ uint32_t dipStartTime;
+ uint32_t prevMillis = 0;
+ uint32_t lightChangeInterval = 2000;
+ bool timeToDip = false;
+ bool phoneyTVstate = true;
+
+ if (phoneyTVstate) { //
+ color = BLUE;
+ briT = 100;
+ SEGMENT.color = fill(color);
+
+ if (!timeToDip) {
+ currentMillis = millis();
+ }
+
+ if (currentMillis - prevMillis > lightChangeInterval) {
+ // time to adjust effect parameters
+ previousMillis = currentMillis;
+ lightChangeInterval = random(750, 4001); //Adjusts the interval for more/less frequent random light changes
+ twitch = random(40, 100); //twitch provides motion effect but can be a bit much if too high
+ dipCount = dipCount++;
+ }
+
+ if (currentMillis - previousMillis < twitch) {
+ // time to adjust entire strip color & brightness
+ color.r = random(0,255);
+ color.g = random(0,255);
+ color.b = random(0,255);
+
+ briT = random(50,255);
+ fill(color);
+
+ if (dipCount > dipInterval) timeToDip(true);
+ }
+ } else {
+ currentDipTime = millis();
+
+ if (currentDipTime - dipStartTime < darkTime) {
+ briT = 0; // set strip to dark // setBrightness(0);
+ } else {
+ isItTimeToDip(false);
+ }
+ } else { phoneyTVstate = false
+ if (phoneyTVstate != oldPhoneyTVstate) {
+ briT =0; // set strip to dark // setBrightness(0);
+ }
+ }
+ oldPhoneyTVstate = phoneyTVstate;
+ return FRAMETIME;
+}
+
+void isItTimeToDip(bool dipTime) {
+ timeToDip = dipTime;
+ if (dipTime) {
+ dipCount = 0;
+ dipStartTime = millis();
+ darkTime = random(50, 150);
+ dipInterval = random(5, 250);
+ }
+}
\ No newline at end of file
FX.h.diff.txt
--- WLED-master/wled00/FX.h 2020-12-03 04:22:10.000000000 -0500
+++ "WLED-master (1)/WLED-master/wled00/FX.h" 2020-12-04 23:00:05.908148700 -0500
@@ -232,6 +232,7 @@
#define FX_MODE_CHUNCHUN 111
#define FX_MODE_DANCING_SHADOWS 112
#define FX_MODE_WASHING_MACHINE 113
+#define FX_MODE_PHONEYTV 114
class WS2812FX {
typedef uint16_t (WS2812FX::*mode_ptr)(void);
@@ -437,6 +438,7 @@
_mode[FX_MODE_CHUNCHUN] = &WS2812FX::mode_chunchun;
_mode[FX_MODE_DANCING_SHADOWS] = &WS2812FX::mode_dancing_shadows;
_mode[FX_MODE_WASHING_MACHINE] = &WS2812FX::mode_washing_machine;
+ _mode[FX_MODE_PHONEYTV] = &WS2812FX::mode_phoneytv;
_brightness = DEFAULT_BRIGHTNESS;
currentPalette = CRGBPalette16(CRGB::Black);
@@ -644,6 +646,7 @@
mode_chunchun(void),
mode_dancing_shadows(void),
mode_washing_machine(void);
+ mode_phoneytv(void);
private:
NeoPixelWrapper *bus;
@@ -731,7 +734,7 @@
"Twinklefox","Twinklecat","Halloween Eyes","Solid Pattern","Solid Pattern Tri","Spots","Spots Fade","Glitter","Candle","Fireworks Starburst",
"Fireworks 1D","Bouncing Balls","Sinelon","Sinelon Dual","Sinelon Rainbow","Popcorn","Drip","Plasma","Percent","Ripple Rainbow",
"Heartbeat","Pacifica","Candle Multi", "Solid Glitter","Sunrise","Phased","Twinkleup","Noise Pal", "Sine","Phased Noise",
-"Flow","Chunchun","Dancing Shadows","Washing Machine"
+"Flow","Chunchun","Dancing Shadows","Washing Machine", "Phoney TV"
])=====";
@@ -741,7 +744,7 @@
"Pastel","Sunset 2","Beech","Vintage","Departure","Landscape","Beach","Sherbet","Hult","Hult 64",
"Drywet","Jul","Grintage","Rewhi","Tertiary","Fire","Icefire","Cyane","Light Pink","Autumn",
"Magenta","Magred","Yelmag","Yelblu","Orange & Teal","Tiamat","April Night","Orangery","C9","Sakura",
-"Aurora","Atlantica","C9 2","C9 New"
+"Aurora","Atlantica","C9 2","C9 New","Temperature"
])=====";
#endif