The logic is just to get the code working with the static methods. I am getting "undefined reference to" error how do call static members inside the methods inside a class?
The code looks like this#
class ResetValueTimer{
public :
static unsigned long calledTimeString;
static int stringCalled ;
static String resetIn(String from, String to, unsigned long seconds){
if(!ResetValueTimer::stringCalled){
ResetValueTimer::calledTimeString = millis();
ResetValueTimer::calledTimeString = 1;
}
if(millis() - ResetValueTimer::calledTimeString >= seconds){
ResetValueTimer::stringCalled = 0;
return to;
}
return from;
}
};
void setup(){
}
String foo= "HELLO WORLD";
String boo = "BYE WORLD";
void loop(){
foo= ResetValueTimer::resetIn(foo,boo,2000);
boo= ResetValueTimer::resetIn(boo,"NOTHING NOT CHANGE",2000);
Serial.print("foo : ");
Serial.print(millis()/60);
Serial.print(": "+foo);
Serial.print("| boo : ");
Serial.print(millis()/60);
Serial.println(": "+boo);
}