ทดลองทำตามกระตู้แล้วค่ะ แล้วมันก็ขึ้น online ค่3วิแล้วมันก็ขึ้น was not online ใช้โค้ดตามนี้ค่ะ
#include <BlynkSimpleEsp8266.h>
#define MA_SPEED D1
#define MA_DIRECT D3
char auth[] = “ZzUKMqYAwIKWS2wtN_Bvi51MbhQoCwYF”;
char ssid[] = “จาเหลือ”;
char pass[] = “23456789”;
char sever[] = “49.229.108.138”;
int port = 8080;
BLYNK_WRITE( V0 ) {
int x = param[0].asInt();
int y = param[1].asInt();
Serial.print(x);
Serial.print(",");
Serial.println(y);
}
void setup() {
Serial.begin(115200);
Blynk.begin(auth, ssid, pass, “49.229.108.138”, 8080);
pinMode( MA_SPEED,OUTPUT);
pinMode( MA_DIRECT,OUTPUT);
Serial.begin(115200);
WiFi.begin(ssid, pass);
while(WiFi.status() != WL_CONNECTED ) {
Serial.println(".");
delay(100);
}
Serial.println(“Blynk connecting”);
Blynk.config(auth);
Blynk.connect(5000);
if(Blynk.connected()) {
Serial.println(“Blynk started”);
}else{
Serial.println(“Blynk can not be started”);
}
// put your setup code here, to run once:
}
void loop() {
if(Blynk.connected() ) {
Blynk.run();
}else{
Serial.println(“offline”);
delay(1000);
}
// put your main code here, to run repeatedly:
}
ใส่แค่ 20 ก็พอครับ