Posts

NODEMCU

Image
 

HOME-AUTOMATION USING GOOGLE HOME, NODEMCU, SINRIC PRO

Image
Libraries to Add: * ArduinoJSON * WEBSOCKETS * SinricPro_Generic // **************************** CODE BEGIN *********************************** #ifdef ENABLE_DEBUG         #define DEBUG_ESP_PORT Serial         #define NODEBUG_WEBSOCKETS         #define NDEBUG  #endif      #include <Arduino.h>  #ifdef ESP8266           #include <ESP8266WiFi.h>  #endif    #ifdef ESP32             #include <WiFi.h>  #endif    #include "SinricPro.h"  #include "SinricProSwitch.h"    #include <map>    #define WIFI_SSID         "hello"       #define WIFI_PASS         "helloworld"  #define APP_KEY           "6fa2c48b-b08b-438f-9d93-32064ae6fc94"        ...

IDE SETUP FILES

Image
               ____________________________________________________________________                 Drivers Installation:  (Universal Zip) Link0:   Click to download  Link1:  Click to download   Link2:  Click to Download             _____________________________________________________________________ Boards Manager URL:     http://arduino.esp8266.com/stable/package_esp8266com_index.json           _____________________________________________________________________ ThingSpeak Library zip :       Click to Download.           _____________________________________________________________________ LCD library Zip:       Click to Download             _______________________________________________...

NON-SERVER CONTROLLER

Image
        /* // SERVERLESS CONTROL FOR APPLIANCES // */ // *********************** CODE BEGIN ************************// #include <ESP8266WiFi.h> const char WiFiPassword[] = "USER_NODE"; const char AP_NameChar[] = "helloworld" ;   WiFiServer server(80);   String header = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"; String html_1 = "<!DOCTYPE html><html><head><title>LED Control</title></head><body><div id='main'><h2>LED Control</h2>"; String html_2 = "<form id='F1' action='LEDON'><input class='button' type='submit' value='LED ON' ></form><br>"; String html_3 = "<form id='F2' action='LEDOFF'><input class='button' type='submit' value='LED OFF' ></form><br>"; String html_4 = "</div></body></html>";...

SERVER BASED REMOTE

Image
  Control your Things from any Corner of world.......!! /************************ CODE BEGINS HERE ************************/ #include <ThingSpeak.h>               // add library #include <ESP8266WiFi.h> WiFiClient  client; unsigned long counterChannelNumber = 980157;                // Channel ID const char * myCounterReadAPIKey = "CL8DHB4NZ43291ZI";      // Read API Key const int FieldNumber1 = 1;                                 // The field you wish to read const int FieldNumber2 = 2;                                 // The field you wish to read void setup() {   pinMode(13,OUTPUT);   Serial.begin(115200);   Serial.println();   WiFi.begin("WIFI_SSID", "WIFI_PASS");      ...

Print String on 16X2 LCD

Image
  /************************ CODE BEGINS HERE ****************************/ // include the library code: #include <LiquidCrystal.h> // Creates an LCD object. Parameters: (rs, enable, d4, d5, d6, d7) LiquidCrystal lcd(D1, D2, D4, D5, D6, D7); void setup() {   // set up the LCD's number of columns and rows:   lcd.begin(16, 2);   // Clears the LCD screen   lcd.clear(); } void loop() {     // Print a message to the LCD.     lcd.print(" Hello !");     // set the cursor to column 0, line 1     // (note: line 1 is the second row, since counting begins with 0):     lcd.setCursor(0, 1);          // Print a message to the LCD.     lcd.print(" Nouman Here!"); } /***************************** CODE END *************************/