Hi guyss can you pls correct this code , this have some mistakes plsss and i cannot find the mistakes

#include <ESP8266HTTPClient.h>
#include "DHT.h"
#define DHTPIN D1
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);

#include "Ubidots.h"
#define TOKEN "BBFF-ZYdGJ8gfniiLkIgdSY0c7O2xyHip07" // Put here your Ubidots TOKEN
#define WIFISSID "greenhouse"
#define PASSWORD "1234567890"
int vs = A0;
int vs1 = D0;
int percentValue = 0;
Ubidots client(TOKEN);
unsigned long lastMillis = 0;

void setup(){
Serial.begin(115200);
dht.begin();
delay(10);
client.wifiConnection(WIFISSID, PASSWORD);
pinMode(vs ,INPUT);
pinMode(vs1 ,INPUT);
Wire.begin(2,0);
lcd.init();
lcd.backlight();
lcd.home();
}
void loop(){

if (millis() - lastMillis > 10000) {  ///every 10S

  float humedad = dht.readHumidity();
  float temperatura = dht.readTemperature();
  float data      = analogRead(vs);
  float data1      = digitalRead(vs1);
  percentValue = map(data, 1023, 200, 0, 100);
        lastMillis = millis();
        client.add("humrel", humedad);
        client.add("temperature", temperatura);
        client.add("soil", percentValue);
         client.add("LDR", data1)
        ;lcd.clear();
        lcd.setCursor(0,0);
        lcd.print("H:"); lcd.print(humedad); lcd.print("% S:"); lcd.print(percentValue); lcd.print("%");
        lcd.setCursor(0,1);
        lcd.print("T:"); lcd.print(temperatura); lcd.print("C L:"); lcd.print(data1); lcd.print("%");   
        
        delay(500);
        }

}

Hello, do yourself a favour and please read How to get the best out of this forum and modify your post accordingly (including code tags and necessary documentation for your ask).

--

as this is not an installation problem, I've moved your post to a more suitable place

What issues? Does it compile?

Besides the improperly posted code there is other important information missing. Please read the how to get the most from the forum post.

Writing some form of "please" or "pls" or "plssss" in the titel
does the opposite of helpfulness. To me personal it creates UNwillingness to help.

I'm very sure: you really want help

From readin this titel you gave an impression of beeing whiny lazy and others shall do your part of the work. This impression creates the UNwillingness to help

You can change this impression by reading what your part of the work is that you can do even if you know nothing about programming by reading the how to get the best out of this forum which is already linked to in the above postings

You may thing "oh man I thought this would be easy".

No ! ... The truth is: there is some work behind it
best regards Stefan

2 Likes

I agree. If the poster is too lazy to read the sticky post of "how to get the most from the form", too lazy to form a complete sentence and too lazy to even spell correctly, then I am uninclined to even read the post.

I will forgive the first 3 spelling errors if English is not his/her native language...

Yeah and too lazy to add code tags…

rain check …

bro its getting D1 not declared
idk wht to do

pls help me out i am new to this i just watched one youtube video for how to make smart iot based greenhouse and it was 2years ago video so ig it has old codes and i just copied the code frm the youtube guy and i have project of this whose submission is on 15th dec pls can you check the errors cause i had many errors
thnx for cooperating

bro i am new to arduino i dk anything abt it

i really need help cause i am new to arduino and its urgent for me to make this project so i need someone to help me out with this

I would guess, you don't have an ESP8266 selected as target.

The audacity of the OP is beyond belief.

1 Like

repeating that you want help it is

not enough

to ask in such a demanding way.

It is your problem that everything became urgent.

Show

own effort

by RE-editing your first posting so that

all code

is inside a code-section. You can read here

Then post a

detailed description

what is the difference between what the code is actually doing and what the code shall do instead

posting again just "I need help" is just

waisting time

best regards Stefan

invest time in learning there are tons of tutorials.
after many posts here and renewed asks you did not even have the decency to fix the first post and keep asking for someone to do your job... well if you don't have time to learn, don't have time to fix your post and respect the forum, then I don't have time for you.

Bye. good luck with your project. I'm out of here

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.