![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Punjenje i pražnjenje spremnika vode
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:1a5027292b9a
- Child:
- 1:07c01a8966ae
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Sep 08 11:15:30 2022 +0000 @@ -0,0 +1,34 @@ +#include "mbed.h" +#include "spremnikVode.h" + +int main() { + + while (1) { + + if (sw) { + + // razina vode ja pala ispod dopustene + if (!sensor && !button) { + full = false; + flash(led, 1000); + } else { led = false; } + + // punjenje + if (!sensor && button) { + full = false; + full = startFilling (); + buzzer = false; + } + + // spremnik je napunjen + if (full && sensor) { + gLed = true; + } else { gLed = false;} + + } + } +} + + + +