Page 239 - 2
P. 239

*
             * Change WiFi ssid, pass, and Blynk auth token to run :)
             *
             **************************************************************/
             #define BLYNK_PRINT Serial       // Comment this out to disable prints and save space
            #include <ESP8266WiFi.h>
            #include <BlynkSimpleEsp8266.h>
            #include <DHT.h>// 온습도센서
            #define REED_SWITCH A0//    조도센서
            #define PIR_SWITCH 2 //  인체감지센서


            // You should get Auth Token in the Blynk App.
            // Go to the Project Settings (nut icon).
            char auth[] = "5a9d9b7e42014a4cac24bfab463028f9";


            // Your WiFi credentials.
            // Set password to "" for open networks.
            char ssid[] = "";
            char pass[] = "";
            WidgetLED led(V0);// 인체감지


            int pState = HIGH;// 조도센서
            int pfeel = HIGH;// 인체감지센서


            #define DHTPIN 2            // What digital pin we're connected to  온습도


            // Uncomment whatever type you're using!
            #define DHTTYPE DHT11          // DHT 11  온습도
            //#define DHTTYPE DHT22       // DHT 22, AM2302, AM2321
            //#define DHTTYPE DHT21       // DHT 21, AM2301


            DHT dht(DHTPIN, DHTTYPE);//     온습도
            BlynkTimer                                                                      timer;// 온습도l;p'l;




            // This function sends Arduino's up time every second to Virtual Pin (5).
            // In the app, Widget's reading frequency should be set to PUSH. This means
            // that you define how often to send data to Blynk App.


            void sendSensor()
            {
              float h = dht.readHumidity();
              float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit


              if (isnan(h) || isnan(t)) {


                                                         - 239 -
   234   235   236   237   238   239   240   241   242   243   244