I need assitance to get the sensor readings into ubidots using ARDUINO AND ESP8266.(for example sending ir sensor data to ubidots ).i used this code it is not working
#define TOKEN "******"
#define ID_1 "********" // Put here your Ubidots variable ID
#define ID_2 "*********" // Put here your Ubidots variable ID
#define ID_3 "*********"
#define WIFISSID "********"
#define PASSWORD "******"
Ubidots client(TOKEN);
#include <SoftwareSerial.h>
#include "DHT.h"
#define DHTPIN 5
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
int irpin=5;
int enter=0;
void setup(){
Serial.begin(115200);
delay(10);
client.wifiConnection(WIFISSID, PASSWORD);
Serial.begin(9600);
Serial.begin(9600);
dht.begin();
pinMode(irpin,INPUT);
}
void loop(){
float value1 = dht.readHumidity();
Serial.println(value1);
float value2 = dht.readTemperature();
Serial.println(value2);
// int h = dht.readHumidity();
// delay(1000);
// Read temperature as Celsius (the default)
//int t = dht.readTemperature();
// delay(1000);
int c,i,count=0,rpm,v;
for(i=0;i<=1000;++i)
{
c=analogRead(irpin);
if(c<400)
{
enter=1;
}
if ( (c>400)&& (c>v)&& (enter==1))
{
count++;
enter=0;
}
delay(1);
v=0;
}
rpm=count*53.5;
Serial.println(rpm);
client.add(ID_1,value1);
client.add(ID_2,value2);
client.add(ID_3, rpm);
client.sendAll(false);
delay(5000);
}