iot_water_monitor_v2

Dependencies:   easy-connect-v16 Watchdog FP MQTTPacket RecordType-v-16 watersenor_and_temp_code

Committer:
DuyLionTran
Date:
Mon Jan 08 18:07:56 2018 +0000
Revision:
32:8226837c56ae
Parent:
18:5585365d6951
Child:
36:d0b628087ac8
version 2.1;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DuyLionTran 32:8226837c56ae 1 #ifndef __READSENSOR_H__
DuyLionTran 32:8226837c56ae 2 #define __READSENSOR_H__
DuyLionTran 32:8226837c56ae 3
DuyLionTran 32:8226837c56ae 4 #define SENSOR_1_PIN (A0)
DuyLionTran 32:8226837c56ae 5 #define SENSOR_2_PIN (A1)
DuyLionTran 32:8226837c56ae 6 #define SENSOR_3_PIN (A3)
DuyLionTran 32:8226837c56ae 7 #define SENSOR_4_PIN (A4)
DuyLionTran 32:8226837c56ae 8
DuyLionTran 32:8226837c56ae 9 #define SaturationDoVoltageAddress 12 //the address of the Saturation Oxygen voltage stored in the Flash
DuyLionTran 32:8226837c56ae 10 #define SaturationDoTemperatureAddress 16 //the address of the Saturation Oxygen temperature stored in the Flash
DuyLionTran 32:8226837c56ae 11
DuyLionTran 32:8226837c56ae 12 #define VREF 3.3
DuyLionTran 32:8226837c56ae 13 #define SCOUNT 30
DuyLionTran 32:8226837c56ae 14
DuyLionTran 32:8226837c56ae 15 /** brief Perform calibration for pH sensor
DuyLionTran 32:8226837c56ae 16 * retral None
DuyLionTran 32:8226837c56ae 17 */
DuyLionTran 32:8226837c56ae 18 void SENSOR_Calib();
DuyLionTran 32:8226837c56ae 19
DuyLionTran 32:8226837c56ae 20 /** brief Read the analog value of pH sensor
DuyLionTran 32:8226837c56ae 21 * retral pH ADC value
DuyLionTran 32:8226837c56ae 22 */
DuyLionTran 32:8226837c56ae 23 float SENSOR_ReadPHADC();
DuyLionTran 32:8226837c56ae 24
DuyLionTran 32:8226837c56ae 25 /** brief Convert the ADC value read from pH sensor into pH value
DuyLionTran 32:8226837c56ae 26 * retral pH value
DuyLionTran 32:8226837c56ae 27 */
DuyLionTran 32:8226837c56ae 28 float SENSOR_GetPHValue();
DuyLionTran 32:8226837c56ae 29
DuyLionTran 18:5585365d6951 30 #endif /* __READSENSOR_H__ */