![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Punjenje i pražnjenje spremnika vode
Dependencies: mbed
Diff: main.cpp
- Revision:
- 1:07c01a8966ae
- Parent:
- 0:1a5027292b9a
--- a/main.cpp Thu Sep 08 11:15:30 2022 +0000 +++ b/main.cpp Fri Sep 09 00:14:08 2022 +0000 @@ -5,19 +5,21 @@ while (1) { - if (sw) { + sw.rise(&turnOn); + + if (on) { - // razina vode ja pala ispod dopustene + // razina vode je pala ispod dopustene if (!sensor && !button) { full = false; flash(led, 1000); } else { led = false; } - + // punjenje if (!sensor && button) { full = false; full = startFilling (); - buzzer = false; + yLed = false; } // spremnik je napunjen @@ -25,6 +27,13 @@ gLed = true; } else { gLed = false;} + // aktivacija buzzera + if (full && button) { + + buttonPressed(); + + } + } } } @@ -32,3 +41,4 @@ +