
iot_water_monitor_v2
Dependencies: easy-connect-v16 Watchdog FP MQTTPacket RecordType-v-16 watersenor_and_temp_code
Application/CommandExecution.cpp@48:a7ed665844cd, 2018-03-08 (annotated)
- Committer:
- DuyLionTran
- Date:
- Thu Mar 08 16:38:35 2018 +0000
- Revision:
- 48:a7ed665844cd
- Parent:
- 43:dcde0e66874a
- Child:
- 50:5a19fc4b41d9
* version 2.7.5a 03-08-2018: DS18B20 problem discovered at line 42th ReadSensor.cpp; Upload RTC time converted to epoch
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DuyLionTran | 32:8226837c56ae | 1 | #include "CommandExecution.h" |
DuyLionTran | 39:a5ee98bd0050 | 2 | #include "ReadSensor.h" |
DuyLionTran | 32:8226837c56ae | 3 | #include "mbed.h" |
DuyLionTran | 32:8226837c56ae | 4 | |
DuyLionTran | 32:8226837c56ae | 5 | DigitalOut relay1(RELAY_1_PIN); |
DuyLionTran | 32:8226837c56ae | 6 | DigitalOut relay2(RELAY_2_PIN); |
DuyLionTran | 34:601effb7b7fe | 7 | DigitalOut relay3(RELAY_3_PIN); |
DuyLionTran | 32:8226837c56ae | 8 | |
DuyLionTran | 41:6aed398adcc4 | 9 | extern bool isCalibrating; |
DuyLionTran | 48:a7ed665844cd | 10 | extern bool isUploadImmediately; |
DuyLionTran | 41:6aed398adcc4 | 11 | |
DuyLionTran | 34:601effb7b7fe | 12 | void CE_HandleRelays(int Relay1State, int Relay2State, int Relay3State) { |
DuyLionTran | 32:8226837c56ae | 13 | relay1 = Relay1State; |
DuyLionTran | 32:8226837c56ae | 14 | relay2 = Relay2State; |
DuyLionTran | 34:601effb7b7fe | 15 | relay3 = Relay3State; |
DuyLionTran | 32:8226837c56ae | 16 | } |
DuyLionTran | 35:fc800d35c1ba | 17 | |
DuyLionTran | 35:fc800d35c1ba | 18 | void CE_SetRTCTime(uint32_t CurrentEpochTime) { |
DuyLionTran | 36:d0b628087ac8 | 19 | printf("New local time value set\r\n"); |
DuyLionTran | 35:fc800d35c1ba | 20 | set_time(CurrentEpochTime); |
DuyLionTran | 39:a5ee98bd0050 | 21 | } |
DuyLionTran | 39:a5ee98bd0050 | 22 | |
DuyLionTran | 39:a5ee98bd0050 | 23 | void CE_Calibrate() { |
DuyLionTran | 41:6aed398adcc4 | 24 | isCalibrating = true; |
DuyLionTran | 43:dcde0e66874a | 25 | } |
DuyLionTran | 43:dcde0e66874a | 26 | |
DuyLionTran | 43:dcde0e66874a | 27 | void CE_SetAlarmRelays() { |
DuyLionTran | 43:dcde0e66874a | 28 | |
DuyLionTran | 43:dcde0e66874a | 29 | } |
DuyLionTran | 43:dcde0e66874a | 30 | |
DuyLionTran | 43:dcde0e66874a | 31 | void CE_UpdateImmediately() { |
DuyLionTran | 48:a7ed665844cd | 32 | isUploadImmediately = true; |
DuyLionTran | 35:fc800d35c1ba | 33 | } |