1、开发前准备:
请参考:[超链接](https://blog.csdn.net/weixin_48645526/article/details/108296927)
2、arduino为主的服务端
#include<ESP8266WiFi.h>
#include<Servo.h>
#define Duo D5
Servo myDuo;
char* ssid = “dzx”; //“wifi热点名称”
char* passwd = “dzx521hsn”; //wifi密码
void initWifiSta()
{
WiFi.mode(WIFI_STA); //设置STA模式
WiFi.begin(ssid, passwd); //连接网络
while (WiFi.status() != WL_CONNECTED) { //判断是否连接上
Serial.print(".");
delay(500);
}
Serial.println(WiFi.localIP());
}
int port = 9999; //设置端口号
WiFiServer server(port); //设置服务端端口号
void setup() {
Serial.begin(115200);
initWifiSta();
server.begin();
myDuo.attach(Duo); //连接舵机
}
void loop() {
char cmd;
WiFiClient client = server.available(); /