indeed Arduino IDE can ignore the warning and continue compile with board Arduino UNO, but will end in error when compile with ESP8266.
start at line 54 in file MoonPhase.cpp
`int MoonPhase::GetType(float phaseval){
if(phaseval < 0.5){
//waxing
return 1;
} else if(phaseval > 0.5){
return 2; // waning
}
}`
how about if value of variable phaseval is 0.5? no more no less, what int number should to return?
so be as start at line 69 in file MoonPhase.cpp
`int MoonPhase::GetPercentage(float phaseval){
if(phaseval < 0.5){
return (phaseval-0.0)/(0.5-0.0) * 100; //(value-min)/(max-min)
} else if(phaseval > 0.5){
return (1.0-((phaseval-0.5)/(1.0-0.5))) * 100; //(value-min)/(max-min) // flip for waning
}
}`
there are same issue too.
shall i edit code like this?
`int MoonPhase::GetPercentage(float phaseval){
if(phaseval < 0.5){
return (phaseval-0.0)/(0.5-0.0) * 100; //(value-min)/(max-min)
} else { // <-- i edit here
return (1.0-((phaseval-0.5)/(1.0-0.5))) * 100; //(value-min)/(max-min) // flip for waning
}
}`
indeed Arduino IDE can ignore the warning and continue compile with board Arduino UNO, but will end in error when compile with ESP8266.
start at line 54 in file MoonPhase.cpp
`int MoonPhase::GetType(float phaseval){
}`
how about if value of variable phaseval is 0.5? no more no less, what int number should to return?
so be as start at line 69 in file MoonPhase.cpp
`int MoonPhase::GetPercentage(float phaseval){
}`
there are same issue too.
shall i edit code like this?
`int MoonPhase::GetPercentage(float phaseval){
}`