das
OUTS.cpp
- Committer:
- Paaranoja
- Date:
- 2017-01-21
- Revision:
- 0:ffef1cca62a8
File content as of revision 0:ffef1cca62a8:
#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; } }