Time: 17:33 Date: 10/12/2017 Description: Task 1,7,8 Currently Functioning
Dependencies: BME280 BMP280 TextLCD
Working Repository
DATA.cpp@50:3d61ca637399, 2018-01-09 (annotated)
- Committer:
- thomasmorris
- Date:
- Tue Jan 09 12:19:12 2018 +0000
- Revision:
- 50:3d61ca637399
- Parent:
- 38:8d86e0d8a816
Dynamic Dating Working
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
thomasmorris | 8:0e4481b64353 | 1 | #include "mbed.h" |
chills | 10:46946784326d | 2 | #include <string> |
chills | 10:46946784326d | 3 | #include "rtos.h" |
thomasmorris | 8:0e4481b64353 | 4 | #include "DATA.hpp" |
thomasmorris | 8:0e4481b64353 | 5 | |
thomasmorris | 8:0e4481b64353 | 6 | DATA::DATA() |
thomasmorris | 8:0e4481b64353 | 7 | { |
thomasmorris | 8:0e4481b64353 | 8 | |
thomasmorris | 8:0e4481b64353 | 9 | } |
thomasmorris | 8:0e4481b64353 | 10 | |
chills | 15:c1592fc1a501 | 11 | void DATA::set_time(int time) |
thomasmorris | 8:0e4481b64353 | 12 | { |
thomasmorris | 8:0e4481b64353 | 13 | _Time = time; |
thomasmorris | 8:0e4481b64353 | 14 | } |
chills | 10:46946784326d | 15 | void DATA::set_temperature(double temp) |
thomasmorris | 8:0e4481b64353 | 16 | { |
thomasmorris | 8:0e4481b64353 | 17 | _Temperature = temp; |
thomasmorris | 8:0e4481b64353 | 18 | } |
chills | 10:46946784326d | 19 | void DATA::set_pressure(double pressure) |
thomasmorris | 8:0e4481b64353 | 20 | { |
thomasmorris | 8:0e4481b64353 | 21 | _Pressure = pressure; |
thomasmorris | 8:0e4481b64353 | 22 | } |
chills | 10:46946784326d | 23 | void DATA::set_light(double light) |
thomasmorris | 8:0e4481b64353 | 24 | { |
thomasmorris | 8:0e4481b64353 | 25 | _Light = light; |
thomasmorris | 8:0e4481b64353 | 26 | } |
thomasmorris | 38:8d86e0d8a816 | 27 | |
thomasmorris | 38:8d86e0d8a816 | 28 | void DATA::set_all_zero() |
thomasmorris | 38:8d86e0d8a816 | 29 | { |
thomasmorris | 38:8d86e0d8a816 | 30 | _Time = 0; |
thomasmorris | 38:8d86e0d8a816 | 31 | _Temperature = 0; |
thomasmorris | 38:8d86e0d8a816 | 32 | _Pressure = 0; |
thomasmorris | 38:8d86e0d8a816 | 33 | _Light = 0; |
thomasmorris | 38:8d86e0d8a816 | 34 | } |
thomasmorris | 38:8d86e0d8a816 | 35 | |
thomasmorris | 8:0e4481b64353 | 36 | //Getters |
chills | 15:c1592fc1a501 | 37 | int DATA::get_time() |
thomasmorris | 8:0e4481b64353 | 38 | { |
thomasmorris | 8:0e4481b64353 | 39 | return _Time; |
thomasmorris | 8:0e4481b64353 | 40 | } |
chills | 10:46946784326d | 41 | double DATA::get_temperature() |
thomasmorris | 8:0e4481b64353 | 42 | { |
thomasmorris | 8:0e4481b64353 | 43 | return _Temperature; |
thomasmorris | 8:0e4481b64353 | 44 | } |
chills | 10:46946784326d | 45 | double DATA::get_pressure() |
thomasmorris | 8:0e4481b64353 | 46 | { |
thomasmorris | 8:0e4481b64353 | 47 | return _Pressure; |
thomasmorris | 8:0e4481b64353 | 48 | } |
chills | 10:46946784326d | 49 | double DATA::get_light() |
thomasmorris | 8:0e4481b64353 | 50 | { |
thomasmorris | 8:0e4481b64353 | 51 | return _Light; |
thomasmorris | 8:0e4481b64353 | 52 | } |