Temperature Sensor DHT readings to FRDMk64f
Fork of Hexi_Blinky_Example by
Diff: main.cpp
- Revision:
- 17:690d692b29cb
- Parent:
- 16:39e45e59677c
- Child:
- 18:293c2885af81
--- a/main.cpp Wed Apr 05 19:17:14 2017 +0000 +++ b/main.cpp Sun Apr 23 05:09:47 2017 +0000 @@ -7,8 +7,8 @@ #define APIKEY JJAOBK32WOINKT00 //Put "Write key" of your channel in thingspeak.com #define IP "184.106.153.149" // IP Address of "api.thingspeak.com\" -#define WIFI_SSID "Redmi" -#define WIFI_PASS "akash12345" +#define WIFI_SSID "Batman2G" +#define WIFI_PASS "Alien12345" Serial FRDM_UART_Debug(USBTX,USBRX); @@ -16,16 +16,16 @@ // Options are TX-RX - PTB11 - PTB10 , PTC17 - PTC16 , PTC15 - PTC14 SPI SPI_Bus(PTD2,PTD3,PTD1); // (MOSI MISO CLK)setup SPI interface -DigitalOut SPI_CS_AMM(PTB9); -DigitalOut SPI_CS_VOLT(PTA1); +DigitalOut SPI_CS_AMM(PTA2); +DigitalOut SPI_CS_VOLT(PTB9); I2C I2C_Bus(PTE25,PTE24); AnalogIn AN_Thermo(PTB2); // Thermocouple Analog Input -DigitalIn DG_Motion(PTB3); // Motion module Digital Input +DigitalIn DG_Motion(PTC2); // Motion module Digital Input -DHT DHT_Temp_Hum(PTA2,DHT22); //DHT Sensor +DHT DHT_Temp_Hum(PTC4,DHT22); //DHT Sensor const int Light_I2C_Addr = 0x88; @@ -267,7 +267,8 @@ FRDM_UART_Debug.printf(ESP_8266_CMD_Send); wait(2); - if(!strcmp(ESP_8266_CMD_Recv,"WIFI CONNECTED")) + + //if(!strcmp(ESP_8266_CMD_Recv,"WIFI CONNECTED")) { strcpy(ESP_8266_CMD_Send,"AT+CWJAP=\""); strcat(ESP_8266_CMD_Send,WIFI_SSID); @@ -281,8 +282,8 @@ ESP_8266_UART.RcvReply(ESP_8266_CMD_Recv, 400); FRDM_UART_Debug.printf(ESP_8266_CMD_Recv); } - else - FRDM_UART_Debug.printf("Wifi was preconfigured\r\n"); + //else + // FRDM_UART_Debug.printf("Wifi was preconfigured\r\n"); strcpy(ESP_8266_CMD_Send,"AT+CIPMUX=0"); ESP_8266_UART.SendCMD(ESP_8266_CMD_Send);