Da ka xi tong.
Dependencies: libmDot mbed-rtos mbed
Fork of mDot_Connect_IoTClub_one_wire_4ch_8_24 by
Diff: main.cpp
- Revision:
- 10:79124c0a5952
- Parent:
- 9:cf45820af9b9
- Child:
- 11:1ecd1cdca9ef
--- a/main.cpp Sat Aug 13 09:34:57 2016 +0000 +++ b/main.cpp Sat Aug 13 10:27:50 2016 +0000 @@ -7,7 +7,7 @@ #include "AnalogPH.h" //defined for mDot SVB debug, comment it if applying for whole system -#define NO_MULTITECH_GATEWAY +//#define NO_MULTITECH_GATEWAY //Define the number of channels #define NUM_OF_CH 4 @@ -19,19 +19,20 @@ #endif #if (NUM_OF_CH >2) - AnalogPHSensor CH2_PH(PA_4, 0.0, 0.0); + AnalogPHSensor CH2_PH(PA_5, 0.0, 0.0); #endif #if (NUM_OF_CH >3) - AnalogPHSensor CH3_PH(PA_5, 0.0, 0.0); + AnalogPHSensor CH3_PH(PA_4, 0.0, 0.0); #endif // these options must match the settings on your Conduit // uncomment the following lines and edit their values to match your configuration static std::string config_network_name = "chinaiot"; static std::string config_network_pass = "password"; +static uint8_t config_frequency_sub_band = 2; int main() { - + int32_t ret; mDot* dot; std::vector<uint8_t> data; float phValue; @@ -135,10 +136,8 @@ #endif default: break; - } - //for(i=0; i<1;i++) printf("3:[CH%d]", k); + } sprintf(dataBuf, "CH%d:%5.4f", k, phValue); - //for(i=0; i<1;i++) printf("4:[%s]", dataBuf); logInfo("%s", dataBuf); #ifndef NO_MULTITECH_GATEWAY @@ -155,7 +154,8 @@ logInfo("successfully sent data to gateway"); } #endif - } //for + } //for + //printf("++++++++++++++++++++++\t"); // in the 868 (EU) frequency band, we need to wait until another channel is available before transmitting again #ifndef NO_MULTITECH_GATEWAY osDelay(std::max((uint32_t)5000, (uint32_t)dot->getNextTxMs()));