Great tutorial! Integrating a water level indicator with an alarm system is such a practical way to prevent overflow issues, especially for automated irrigation or water storage systems. however I will suggest using this line of code to prevent the water level from going above 100%. ``````````````waterLevel = (waterLevel > 100) ? 100 : waterLevel;````````````` the line of code above is a shorthand for : if (waterLevel > 100) { waterLevel = 100; } else { waterLevel = waterLevel; //i.e remains untouched } I came here from linkedIn. nice meeting you.
Great tutorial! Integrating a water level indicator with an alarm system is such a practical way to prevent overflow issues, especially for automated irrigation or water storage systems.
however I will suggest using this line of code to prevent the water level from going above 100%.
``````````````waterLevel = (waterLevel > 100) ? 100 : waterLevel;`````````````
the line of code above is a shorthand for :
if (waterLevel > 100) {
waterLevel = 100;
} else {
waterLevel = waterLevel; //i.e remains untouched
}
I came here from linkedIn. nice meeting you.