LCD won't display ethernet.begin()

hello,

ethernet.begin()
I deleted it.

Adding doesn't work.

this is my code

#include <SPI.h>
#include <Ethernet.h>
#include <LiquidCrystal.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //Setting MAC Address

#define DHTPIN 8

#define DHTTYPE DHT11
LiquidCrystal lcd( 11, 12, 5, 4, 3, 2);
DHTdht(DHTPIN,DHTTYPE);


float humidityData;
float temperatureData;


IPAddress server(10,0,0,30);
IPAddress ip(10, 20, 0, 95);
IPAddress gateway(10, 20, 0, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress myDns(8, 8, 8, 8);
EthernetClient client;

/* Setup for Ethernet and RFID */

void setup() {
  Serial.begin(9600);
  dht.begin();
  lcd.begin(16,2);
  **Ethernet.begin(mac, ip, gateway, subnet, myDns);**
  delay(1000);
  
 
}
//--------------------------------------------------------------------------------


/* Infinite Loop */
void loop(){
  humidityData = dht.readHumidity();
  temperatureData = dht.readTemperature();
  Sending_To_phpmyadmindatabase();
  delay(1000); // interval
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("ID01 TEMP:");
  lcd.print((float)temperatureData);
  lcd.print("C");
  lcd.setCursor(0,1);
  lcd.print("ID01 NEM:");
  lcd.print(humidityData);
  lcd.print(" %");

}


  void Sending_To_phpmyadmindatabase() //CONNECTING WITH MYSQL
 {
   if (client.connect(server, 80)) {
    Serial.println("connected");
    // Make a HTTP request:
    Serial.print("GET /testcode/dht2.php?humidity=");
    client.print("GET /testcode/dht2.php?humidity="); //YOUR URL
    Serial.println(humidityData);
    client.print(humidityData);
    client.print("&temperature=");
    Serial.println("&temperature=");
    client.print(temperatureData);
    Serial.println(temperatureData);
    client.print(" "); //SPACE BEFORE HTTP/1.1
    client.print("HTTP/1.1");
    client.println();
    client.println("Host: 10.0.0.30");
    client.println("Connection: close");
    client.println();
  } else {
    // if you didn't get a connection to the server:
    Serial.println("connection failed");
  }
 }


I'm waiting for your help

Adding

Welcome to the forum

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum

some of these pins are also used for SPI (e.g. 11, 12).
SPI is used for the Ethernet Shield
4 is used for the SD Card if available on the Ethernet Shield.

Check ALL pins your Ethernet Shield is using.
Don't use them for the LCD.

I have attached the wiring diagram, can you check it?

Hello mehmetmcan

Welcome to the worldbest Arduino forum ever.

This is a nice project to get started.

Keep it simple and stupid firstly.
Follow the example code that comes with the library or
run some tutorials for the hardware selected.
If you are happy with the results of the tutorials you can merge these to your project.

Have a nice day and enjoy coding in C++.

1 Like

Çözüldü problem

Solved problem

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