#include <WiFi.h>//library for wifi
#include <PubSubclient.h>//library for Mott
#include "ultrasonich"
Ultrasonic ultrasonic (2, 4);
float distance
void callback(char* subscribetopic, byte payload, unsigned int payloadLength);
HC-SR04
//.credentials of IBM Accounts
#define ORG "Gyocv"//IBM ORGNITION ID
#define DEVICE_TYPE "smartdustbin//Device type mentioned in ibm watson TOT platform #define DEVICE_ID "12345" //Device 10 mentioned in the watson TOT Platform
#define TOKEN "12345678" //Token
String datal;
//Float h, t
ESP32
Customise the above values
char server[]= ORG ".messaging, internetofthings.ibmcloud.com";// Server Name
char publishTopic[] = "iot-2/evt/Data/fnt/json"; // topic name and type of event perform
char subscribetopic[] = "Lot-2/cmd/test/fmt/String;// cmd REPRESENT comand type AND CO
char authetethod[]"use-token-auth";// authentication method
char token] TOKEN;
char clientid[] = "d:" ORG":"DEVICE_TYPE";" DEVICE_ID;//client id
WiFiClient wifiClient; // creating the instance for wificlient
PubSubClient client (server, 1883, callback wificlient); //calling the prodefined client void setup()// configureing the ESP32
Serial.begin(115200);