DASD
Revision 0:2abe3b8113cc, committed 2017-01-21
- Comitter:
- Paaranoja
- Date:
- Sat Jan 21 15:59:21 2017 +0000
- Commit message:
- DWE
Changed in this revision
| INPUTS.cpp | Show annotated file Show diff for this revision Revisions of this file |
| INPUTS.h | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/INPUTS.cpp Sat Jan 21 15:59:21 2017 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+#include "INPUTS.h"
+
+INPUTS::INPUTS (PinName pot_hum_pin, PinName pot_temp_pin): pot_vlaga(pot_hum_pin), pot_temp(pot_temp_pin){
+ get_hum_req();
+ get_temp_req();
+ }
+
+float INPUTS::get_hum_req(){
+ req_hum = pot_vlaga.read()*99;
+ return req_hum;
+ }
+
+float INPUTS::get_temp_req(){
+ req_temp = (15*pot_temp.read())+20;
+ return req_temp;
+ }
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/INPUTS.h Sat Jan 21 15:59:21 2017 +0000
@@ -0,0 +1,19 @@
+#ifndef INPUTS_H
+#define INPUTS_H
+
+#include "mbed.h"
+
+class INPUTS{
+ public:
+
+ INPUTS(PinName pot_hum_pin, PinName pot_temp_pin);
+ float get_hum_req();
+ float get_temp_req();
+
+ private:
+ AnalogIn pot_vlaga;
+ AnalogIn pot_temp;
+ float req_hum, req_temp;
+
+ };
+#endif
\ No newline at end of file