das
Diff: OUTS.cpp
- Revision:
- 0:ffef1cca62a8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OUTS.cpp Sat Jan 21 15:59:12 2017 +0000 @@ -0,0 +1,35 @@ +#include "mbed.h" +#include "OUTS.h" + + + +OUTS::OUTS(PinName grijac_pin, PinName atomizer_pin, PinName grijac_led_pin, PinName atomizer_led_pin):grijac(grijac_pin), atomizer(atomizer_pin), led_grijac(grijac_led_pin), led_atomizer(atomizer_led_pin){ + grijac = 0; + atomizer = 0; + led_atomizer = 0; + led_grijac = 0; + } + +void OUTS::outs_on(float senzor_temp, float senzor_hum, float pot_temp, float pot_hum){ + chk_temp(senzor_temp, pot_temp); + chk_hum(senzor_hum, pot_hum); + } + +void OUTS::chk_temp(float senzor_temp, float pot_temp){ + if (pot_temp>senzor_temp){ + grijac = 1; + led_grijac = 1; + }else { + grijac = 0; + led_grijac = 0; + } + } +void OUTS::chk_hum(float senzor_hum, float pot_hum){ + if (pot_hum>senzor_hum){ + atomizer = 1; + led_atomizer = 1; + } else { + atomizer = 0; + led_atomizer = 0; + } + } \ No newline at end of file