ไฟล์ .h นี้อยู่ในโฟเดอร์นั้นป่าวเช็คหน่อย
ต้องดู BlynkESP8266-master
โหลด มาผิดตัวครับ ต้องใช้ BlynkSimpleEsp8266.h เต็มๆ ค้นหาครับ
ผมลบทุกอย่างละเริ่มใหม่ดีกว่าครับ
ได้หมดครับ
เชื่อมกับ blynk ได้เเล้วครับเหลือคอมไฟล์โค้ดคำสั่งทำงานครับ
ทำไมพอผมเขียนโค้ดทำฃานใส่เข้าไปมันกับไม่คอนเนคอะครับ
ต้องเอา log มาดูครับ
. Variables and constants in RAM (global, static), used 30020 / 80192 bytes (37%)
║ SEGMENT BYTES DESCRIPTION
╠══ DATA 1532 initialized variables
╠══ RODATA 2552 constants
╚══ BSS 25936 zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 61247 / 65536 bytes (93%)
║ SEGMENT BYTES DESCRIPTION
╠══ ICACHE 32768 reserved space for flash instruction cache
╚══ IRAM 28479 code in IRAM
. Code in flash (default, ICACHE_FLASH_ATTR), used 252388 / 1048576 bytes (24%)
║ SEGMENT BYTES DESCRIPTION
╚══ IROM 252388 code in flash
esptool.py v3.0
Serial port COM3
Connecting…_
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: dc:4f:22:11:7b:39
Uploading stub…
Running stub…
Stub running…
Changing baud rate to 460800
Changed.
Configuring flash size…
Auto-detected Flash size: 4MB
Compressed 289104 bytes to 211716…
Writing at 0x00000000… (7 %)
Writing at 0x00004000… (15 %)
Writing at 0x00008000… (23 %)
Writing at 0x0000c000… (30 %)
Writing at 0x00010000… (38 %)
Writing at 0x00014000… (46 %)
Writing at 0x00018000… (53 %)
Writing at 0x0001c000… (61 %)
Writing at 0x00020000… (69 %)
Writing at 0x00024000… (76 %)
Writing at 0x00028000… (84 %)
Writing at 0x0002c000… (92 %)
Writing at 0x00030000… (100 %)
Wrote 289104 bytes (211716 compressed) at 0x00000000 in 4.8
seconds (effective 484.0 kbit/s)…
Hash of data verified.
Leaving…
Hard resetting via RTS pin…
แต่ตอนสั่งให้คอนเนคอย่างเดี๋ยวขึ้นไฟไซโวลทำงานตามที่พี่ให้ลองคอมไฟล์ก่อนหน้านั้นก็ทำงานเเต่พอผมเอาโค้ดที่เขียนไว้สั่งให้ทำงานผ่านบลิ้ง กลับหลุดคอนเนค
#define BLYNK_TEMPLATE_ID “TMPL6WRuo6w2A”
#define BLYNK_TEMPLATE_NAME “ice”
#define BLYNK_AUTH_TOKEN “2k7EUkxi0pFGrlgnihNcR94NoOz5mTqb”
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Servo.h>
char ssid[] = “Wichian_2..4GHz”;
char pass[] = “0871100338”;
#define SERVO_PIN D6
Servo feederServo;
// ฟังก์ชันสั่งให้อาหาร
void feedFish() {
Serial.println(“Feeding Fish…”);
feederServo.write(0); // เริ่มต้น
delay(500);
feederServo.write(120); // หมุนปล่อยอาหาร
delay(1000);
feederServo.write(0); // กลับตำแหน่งเดิม
}
// รับค่าจากปุ่ม V0
BLYNK_WRITE(V0)
{
int buttonState = param.asInt();
if (buttonState == 1) {
feedFish();}
}
void setup()
{
Serial.begin(9600);
feederServo.attach(SERVO_PIN);
feederServo.write(0);
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
}
void loop()
{
Blynk.run();
}




