Saturday, May 21, 2022

EXP NO 7 PUSH THE TEMPERATURE DATA TO BYLNK IoT


 


// Fill-in information from your Blynk Template here

#define BLYNK_TEMPLATE_ID           "TMPLD1CKpt9_"

#define BLYNK_DEVICE_NAME           "temp"


#define BLYNK_FIRMWARE_VERSION        "0.1.0"


#define BLYNK_PRINT Serial

//#define BLYNK_DEBUG


#define APP_DEBUG


// Uncomment your board, or configure a custom board in Settings.h

//#define USE_SPARKFUN_BLYNK_BOARD

#define USE_NODE_MCU_BOARD

//#define USE_WITTY_CLOUD_BOARD

//#define USE_WEMOS_D1_MINI


#include "BlynkEdgent.h"

#include "DHT.h"

#define DHTPIN D2

#define DHTTYPE DHT22


DHT dht(DHTPIN, DHT22);

float t, h;


void setup()

{

  Serial.begin(115200);

  delay(100);


  BlynkEdgent.begin();

  h = dht.readHumidity();

t = dht.readTemperature();

Blynk.virtualWrite(V0, h);

Blynk.virtualWrite(V1, t);

Serial.begin(9600);

dht.begin();

BlynkEdgent.begin();

delay(2000);


}


void loop() {

  BlynkEdgent.run();

}

No comments:

Post a Comment

Control led light using remote

 // Include IR Remote Library by Ken Shirriff #include <IRremote.h> // Define sensor pin const int RECV_PIN = 4; // Define LED pin #de...