![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Smart Fridge code
Diff: main.cpp
- Revision:
- 3:11a68fb3886f
- Parent:
- 2:9a39ebd76683
- Child:
- 4:834deb7037ff
--- a/main.cpp Fri Apr 19 21:59:14 2019 +0000 +++ b/main.cpp Sat Apr 20 15:00:03 2019 +0000 @@ -11,9 +11,9 @@ #define APIKEY XE2W5EIXWN6LA234 //Put "Write key" of your channel in thingspeak.com #define IP "184.106.153.149" // IP Address of "api.thingspeak.com\" #define WIFI_SSID "Sheelu" -#define WIFI_PASS "Barbie" +#define WIFI_PASS "Barbie123" -//Serial pc(USBTX,USBRX); +Serial pc(USBTX,USBRX); ESP8266 esp(PTC17, PTC16, 115200); // baud rate for wifi @@ -26,7 +26,7 @@ DigitalOut LedGreen(LED2); //Serial connection to PC for output -Serial pc(PTC17, PTC16); // serial comm on the FRDM board +//Serial pc(PTC17, PTC16); // serial comm on the FRDM board //wireless bluetooth connection to Android Device for output Serial blue(PTC15, PTC14); @@ -40,8 +40,8 @@ int main(void) { - blue.baud(115200); - pc.baud(115200); + blue.baud(9600); + //pc.baud(9600); printf("Welcome to RFID Tag Reader Using FRDM K64F...\n\r"); blue.printf("Welcome to RFID Tag Reader Uing FRDM K64F...\n\r"); printf("Bluetooth Enable\r\n"); @@ -92,11 +92,12 @@ { if(counter1 == 0){ printf("\r\nMilk is in the fridge"); - blue.printf("\r\nWhite Card"); + blue.printf("\r\nMilk is in the fridge"); counter1 = 1; } else if(counter1 == 1){ printf("\r\nMilk is out of the fridge"); + blue.printf("\r\nMilk is in out of the fridge"); counter1 = 0; esp_send(); } @@ -107,11 +108,12 @@ if (counter2 == 0) { printf("\r\nBeer is in the fridge"); - blue.printf("\r\nBlue Keychain"); + blue.printf("\r\nBeer is in the fridge"); counter2 = 1; } else if (counter2 == 1){ printf("\r\nBeer is out of the fridge"); + blue.printf("\r\nBeer is in out of the fridge"); counter2 = 0; esp_send(); }