VOOZH about

URL: https://qiita.com/ohisama@github/items/d17ea9a35fd221de88a6

⇱ arduinoでwifi #Arduino - Qiita


👁 Image
2

Go to list of users who liked

1

Share on X(Twitter)

Share on Facebook

Add to Hatena Bookmark

More than 5 years have passed since last update.

@ohisama@github

arduinoでwifi

2
Posted at

オークションで手に入れた、esp8266をarduino unoにつないで見ました。

写真

👁 MVC-008S.JPG

回路図

👁 espk.PNG

ハイパーターミナル

👁 esp.PNG

サンプルコード

# include "ESP8266wifi.h"
# include <SoftwareSerial.h>

# define RST_pin 			7
SoftwareSerial swSerial(10, 11);
int ledPin = 13;
String returnData;
ESP8266wifi wifi(Serial, Serial, RST_pin, swSerial);
void setup()
{
	pinMode(ledPin, OUTPUT);
	swSerial.begin(115200);
	Serial.begin(115200);
	wifi.setTransportToTCP();
	wifi.endSendWithNewline(true);
	wifi.begin();
	wifi.connectToAP("free-spot", "");
}
void loop()
{
	boolean isConnected = wifi.connectToServer("210.169.132.188", "80");
	if (wifi.isConnectedToServer())
	{
		wifi.send(SERVER, "GET / HTTP/1.0\r\n\r\n");
		WifiMessage in = wifi.listenForIncomingMessage(1000);
		if (in.hasData)
		{
			returnData = in.message;
		}
		Serial.println("Return is: " + returnData);
	}
	delay(9000);
}

2

Go to list of users who liked

1
0

Go to list of comments

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2

Go to list of users who liked

1