Open EroshKA opened 5 years ago
The code to check "fullness" of water is at
The default code is supposed to work with "Normal Open". If the wort/water level is not high enough to trigger the level sensor, the level sensor is "Open" and the signal should be "High". When the sensor is "triggered", it should be "closed" and short the PIN to GROUND, which results in "LOW" state of the PIN.
If you get opposite result, change the code to
return (_portvalue & LevelSensorIOExpPin) !=0;
it worked so well for me
// close/connected/ground: not full // open/disconnected/V+: full
bool isWaterLevelFull(void){ // _portvalue is read for button every loop cycle return (_portvalue & LevelSensorIOExpPin) !=1; }
bool isWaterLevelFull(void){ return digitalRead(LevelSensorPin) != 1; }
bool isWaterLevelFull(void){ // _portvalue is read for button every loop cycle return (_portvalue & LevelSensorIOExpPin) !=1; }
bool isWaterLevelFull(void){ return digitalRead(LevelSensorPin) == 1; }
Thanks you
I want to use a normally open level sensor in my system. Can I change the code to work with such a sensor?