![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Punjenje i pražnjenje spremnika vode
Dependencies: mbed
main.cpp@0:1a5027292b9a, 23 months ago (annotated)
- Committer:
- mrimac
- Date:
- Thu Sep 08 11:15:30 2022 +0000
- Revision:
- 0:1a5027292b9a
- Child:
- 1:07c01a8966ae
Spremnik vode;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mrimac | 0:1a5027292b9a | 1 | #include "mbed.h" |
mrimac | 0:1a5027292b9a | 2 | #include "spremnikVode.h" |
mrimac | 0:1a5027292b9a | 3 | |
mrimac | 0:1a5027292b9a | 4 | int main() { |
mrimac | 0:1a5027292b9a | 5 | |
mrimac | 0:1a5027292b9a | 6 | while (1) { |
mrimac | 0:1a5027292b9a | 7 | |
mrimac | 0:1a5027292b9a | 8 | if (sw) { |
mrimac | 0:1a5027292b9a | 9 | |
mrimac | 0:1a5027292b9a | 10 | // razina vode ja pala ispod dopustene |
mrimac | 0:1a5027292b9a | 11 | if (!sensor && !button) { |
mrimac | 0:1a5027292b9a | 12 | full = false; |
mrimac | 0:1a5027292b9a | 13 | flash(led, 1000); |
mrimac | 0:1a5027292b9a | 14 | } else { led = false; } |
mrimac | 0:1a5027292b9a | 15 | |
mrimac | 0:1a5027292b9a | 16 | // punjenje |
mrimac | 0:1a5027292b9a | 17 | if (!sensor && button) { |
mrimac | 0:1a5027292b9a | 18 | full = false; |
mrimac | 0:1a5027292b9a | 19 | full = startFilling (); |
mrimac | 0:1a5027292b9a | 20 | buzzer = false; |
mrimac | 0:1a5027292b9a | 21 | } |
mrimac | 0:1a5027292b9a | 22 | |
mrimac | 0:1a5027292b9a | 23 | // spremnik je napunjen |
mrimac | 0:1a5027292b9a | 24 | if (full && sensor) { |
mrimac | 0:1a5027292b9a | 25 | gLed = true; |
mrimac | 0:1a5027292b9a | 26 | } else { gLed = false;} |
mrimac | 0:1a5027292b9a | 27 | |
mrimac | 0:1a5027292b9a | 28 | } |
mrimac | 0:1a5027292b9a | 29 | } |
mrimac | 0:1a5027292b9a | 30 | } |
mrimac | 0:1a5027292b9a | 31 | |
mrimac | 0:1a5027292b9a | 32 | |
mrimac | 0:1a5027292b9a | 33 | |
mrimac | 0:1a5027292b9a | 34 |