Want to change Program. "Ethernet" to "ESP8266 " ("ESP-WROOM-02")

I want to change program for my "ESP8266 " (“ESP-WROOM-02”).

So I just I tried to change it as shown below.
//参考文献 Ethernet
//#include <SPI.h>
//#include <Ethernet.h>
/WifiSetting********/
// ライブラリの読み込み
#include “ESP8266.h”
#include “Client_ESP8266.h”
// 転送スピード
#define SERIAL_SPEED 115200
/************************* WiFi Access Point /
// Wi-Fi SSID
#define WLAN_SSID "D
"
// Wi-Fi PASSWORD
#define WLAN_PASS "e
"
/
*********************************************************/

//入力ピンの設定
#define PIN_INPUT_BLUE 5
#define PIN_INPUT_YELLOW 7
#define PIN_INPUT_GREEN 9

//参考文献 Ethernet
////MACアドレス(適当に)
//byte mac = {0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
////IPアドレス(適当に)
//byte ip = {192, 168, 0, 123};

//接続先のURL
char HOST = “https://websites.net"; //元々のプログラム"www.example.jp";
String END_POINT = "
*.php”; //元々のプログラム/dev/wwwroot/Sent.php

//参考文献 Ethernet
//EthernetClient client;

void setup() {
// Wi-Fi設定
setupWiFi();

pinMode(PIN_INPUT_BLUE, INPUT);
pinMode(PIN_INPUT_YELLOW, INPUT);
pinMode(PIN_INPUT_GREEN, INPUT);

// パソコンとのシリアル通信のポートを開ける
Serial.begin(SERIAL_SPEED);
// Wi-Fiモジュールとのシリアル通信のポートを開ける
Serial1.begin(SERIAL_SPEED);

// 参考文献 Ethernet
//Serial.begin(9600);

delay(500);
while (!Serial) {
;
}
delay(1000);

// 参考文献 Ethernet
// Ethernet.begin(mac, ip);
// delay(3000);
// Serial.print("IP: ");
// Serial.println(Ethernet.localIP());
// Serial.println(“Ready…”);
// Serial.println();
}

bool onBlue = false;
bool onYellow = false;
bool onGreen = false;

/****Wi-Fiを設定します/
void setupWiFi() {
Serial.print(“Connecting to”);
Serial.println(WLAN_SSID);
// シリアルポートの指定
wifi.begin(Serial1); //RX-D0 TX-D1
// Wi-Fiへ接続(成功するまで処理を繰り返す)
while (!wifi.joinAP(WLAN_SSID, WLAN_PASS)) {
delay(500);
Serial.print(".");
}
Serial.println(“Wi-Fi connected”);
Serial.println("IP address: ");
// Wi-FiのローカルIPアドレスをシリアルモニターへ表示
Serial.println(wifi.getLocalIP().c_str());
}

void loop() {
int blue = digitalRead(PIN_INPUT_BLUE);
int yellow = digitalRead(PIN_INPUT_YELLOW);
int green = digitalRead(PIN_INPUT_GREEN);

switch (blue) {
case HIGH:
if (!onBlue) {
Serial.println(“BLUE ON”);
post(“Blue”, “time-” + String(millis(), DEC));
delay(1000);
onBlue = true;
}
break;
case LOW:
if (onBlue) {
Serial.println(“BLUE OFF”);
onBlue = false;
}
break;
default:
break;
}

switch (yellow) {
case HIGH:
if (!onYellow) {
Serial.println(“YELLOW ON”);
post(“Yellow”, “time-” + String(millis(), DEC));
delay(1000);
onYellow = true;
}
break;
case LOW:
if (onYellow) {
Serial.println(“YELLOW OFF”);
onYellow = false;
}
break;
default:
break;
}

switch (green) {
case HIGH:
if (!onGreen) {
Serial.println(“GREEN ON”);
post(“Green”, “time-” + String(millis(), DEC));
delay(1000);
onGreen = true;
}
break;
case LOW:
if (onGreen) {
Serial.println(“GREEN OFF”);
onGreen = false;
}
break;
default:
break;
}
}

bool post(String title, String message) {
Serial.println(“connecting…”);
if (client.connect(HOST, 80)) {
Serial.println(“connected”);
String query = “title=” + title + “&message=” + message;

client.println(“POST " + END_POINT + " HTTP/1.1”);
client.print("Host: ");
client.println(HOST);
client.println(“Content-Type: application/x-www-form-urlencoded”);
client.println(“User-Agent: Arduino Post Client”);

//ここは無くてもOK
//client.print("Post-Title: ");
//client.println(title);
//client.print("Post-Message: ");
//client.println(message);

client.print("Content-Length: ");
client.println(query.length());

client.println(“Connection: close”);
client.println();
client.print(query);

Serial.println(query);
Serial.println(“sent”);
delay(500);
client.stop();

return true;
}
return false;
}


However, it doesn’t work and error was shown as below.

In file included from C:\Users\y.y\Documents\Arduino\Patern2\Patern2.ino:9:0:

C:\Users\y.y\Documents\Arduino\libraries\Milkcocoa_Arduino_SDK-master/Client_ESP8266.h:27:35: error: expected class-name before ‘,’ token

class ESP8266Client: public Client, public ESP8266 {

^

C:\Users\y.y\Documents\Arduino\Patern2\Patern2.ino: In function ‘void setupWiFi()’:

Patern2:93: error: ‘wifi’ was not declared in this scope

wifi.begin(Serial1); //RX-D0 TX-D1

^

C:\Users\y.y\Documents\Arduino\Patern2\Patern2.ino: In function ‘bool post(String, String)’:

Patern2:183: error: ‘client’ was not declared in this scope

if (client.connect(HOST, 80)) {

^

?ESP8266.h???
???C:\Users\y.y\Documents\Arduino\libraries\ESP8266_Arduino_AT-master
???C:\Users\y.y\Documents\Arduino\libraries\ITEADLIB_Arduino_WeeESP8266-master
exit status 1
‘wifi’ was not declared in this scope

I’ll highly appreciate if you have some advice for me.

Thank you for reading.

The original is shown below.

#include <SPI.h>
#include <Ethernet.h>

//入力ピンの設定
#define PIN_INPUT_BLUE 5
#define PIN_INPUT_YELLOW 7
#define PIN_INPUT_GREEN 9

//MACアドレス(適当に)
byte mac = {0x02, 0x02, 0x02, 0x02, 0x02, 0x02};

//IPアドレス(適当に)
byte ip = {192, 168, 0, 123};

//接続先のURL
char HOST = “www.example.jp”;
String END_POINT = “/path/to/endpoint.php”;

EthernetClient client;

void setup() {
pinMode(PIN_INPUT_BLUE, INPUT);
pinMode(PIN_INPUT_YELLOW, INPUT);
pinMode(PIN_INPUT_GREEN, INPUT);

Serial.begin(9600);
delay(500);
while (!Serial) {
;
}
delay(1000);

Ethernet.begin(mac, ip);
delay(3000);
Serial.print("IP: ");
Serial.println(Ethernet.localIP());
Serial.println(“Ready…”);
Serial.println();
}

bool onBlue = false;
bool onYellow = false;
bool onGreen = false;

void loop() {
int blue = digitalRead(PIN_INPUT_BLUE);
int yellow = digitalRead(PIN_INPUT_YELLOW);
int green = digitalRead(PIN_INPUT_GREEN);

switch (blue) {
case HIGH:
if (!onBlue) {
Serial.println(“BLUE ON”);
post(“Blue”, “time-” + String(millis(), DEC));
delay(1000);
onBlue = true;
}
break;
case LOW:
if (onBlue) {
Serial.println(“BLUE OFF”);
onBlue = false;
}
break;
default:
break;
}

switch (yellow) {
case HIGH:
if (!onYellow) {
Serial.println(“YELLOW ON”);
post(“Yellow”, “time-” + String(millis(), DEC));
delay(1000);
onYellow = true;
}
break;
case LOW:
if (onYellow) {
Serial.println(“YELLOW OFF”);
onYellow = false;
}
break;
default:
break;
}

switch (green) {
case HIGH:
if (!onGreen) {
Serial.println(“GREEN ON”);
post(“Green”, “time-” + String(millis(), DEC));
delay(1000);
onGreen = true;
}
break;
case LOW:
if (onGreen) {
Serial.println(“GREEN OFF”);
onGreen = false;
}
break;
default:
break;
}
}

bool post(String title, String message) {
Serial.println(“connecting…”);
if (client.connect(HOST, 80)) {
Serial.println(“connected”);
String query = “title=” + title + “&message=” + message;

client.println(“POST " + END_POINT + " HTTP/1.1”);
client.print("Host: ");
client.println(HOST);
client.println(“Content-Type: application/x-www-form-urlencoded”);
client.println(“User-Agent: Arduino Post Client”);

//ここは無くてもOK
//client.print("Post-Title: ");
//client.println(title);
//client.print("Post-Message: ");
//client.println(message);

client.print("Content-Length: ");
client.println(query.length());

client.println(“Connection: close”);
client.println();
client.print(query);

Serial.println(query);
Serial.println(“sent”);
delay(500);
client.stop();

return true;
}
return false;
}

If you can't be bothered to read the stickies at the top of the forum, that show, among other things, how to post code properly, we should we be bothered to try to help you?

You'll also learn, reading the stickies, that you need to post links to any non-standard libraries that you are using.