DASD
INPUTS.cpp@0:2abe3b8113cc, 2017-01-21 (annotated)
- Committer:
- Paaranoja
- Date:
- Sat Jan 21 15:59:21 2017 +0000
- Revision:
- 0:2abe3b8113cc
DWE
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Paaranoja | 0:2abe3b8113cc | 1 | #include "mbed.h" |
Paaranoja | 0:2abe3b8113cc | 2 | #include "INPUTS.h" |
Paaranoja | 0:2abe3b8113cc | 3 | |
Paaranoja | 0:2abe3b8113cc | 4 | INPUTS::INPUTS (PinName pot_hum_pin, PinName pot_temp_pin): pot_vlaga(pot_hum_pin), pot_temp(pot_temp_pin){ |
Paaranoja | 0:2abe3b8113cc | 5 | get_hum_req(); |
Paaranoja | 0:2abe3b8113cc | 6 | get_temp_req(); |
Paaranoja | 0:2abe3b8113cc | 7 | } |
Paaranoja | 0:2abe3b8113cc | 8 | |
Paaranoja | 0:2abe3b8113cc | 9 | float INPUTS::get_hum_req(){ |
Paaranoja | 0:2abe3b8113cc | 10 | req_hum = pot_vlaga.read()*99; |
Paaranoja | 0:2abe3b8113cc | 11 | return req_hum; |
Paaranoja | 0:2abe3b8113cc | 12 | } |
Paaranoja | 0:2abe3b8113cc | 13 | |
Paaranoja | 0:2abe3b8113cc | 14 | float INPUTS::get_temp_req(){ |
Paaranoja | 0:2abe3b8113cc | 15 | req_temp = (15*pot_temp.read())+20; |
Paaranoja | 0:2abe3b8113cc | 16 | return req_temp; |
Paaranoja | 0:2abe3b8113cc | 17 | } |