เริ่มต้นใช้งาน NodeMcu ESP8266 ด้วย Arduino IDE

5 Aug 2016,
Share: 

ในบทความที่แล้วเราได้ทําความรู้จักกับ ESP8266 กันแล้ว ในบทความนี้เราจะมาพูดถึงวิธีการใช้งาน ESP8266 ด้วย Arduino IDE โดยจะใช้ ภาษา c/c++ ในการเขียนโปรแกรม

ผมจะยกตัวอย่างการเพิ่มบอร์ด ESP8266 ใน Arduno IED และการเขียนโปรแกรมไฟกระพริบ โดยเครื่องมือที่ต้องใช้คือ

  • NodeMcu(ESP8266) ESP-12e
  • Arduino IDE

เริ่มแรกเปิดโปรแกรม Arduino IED และเลือกเมนู File—>Preferenes

Image

blink-led ในหน้าต่าง Preferences หัวข้อ additional Boards Manager URLs: ให้ใส่ “http://arduino.esp8266.com/stable/package\_esp8266com\_index.json” แล้วกดปุ่ม “ตกลง” ตามรูปด้านล่าง

Image

blink-led เลือกเมนู Tools—>Board:“xxxxx”—>Boards Manager…

Image

blink-led ในหน้าต่าง Boards Manager เลือก Type เป็น Contributed(หมายเลข 1) แล้วกด install esp8266 by ESP8266 Community

Image

blink-led รอจนติดตั้งเสร็จสิ้น

Image

blink-led ปิดโปรแกรม Arduino IDE แล้วเปิดขึ้นมาใหม่ จะเห็นวามี Board ESP8266 เพิ่มขึ้นมา ให้เลือกตาม Board ที่เราต้องการใช้งาน

Image

blink-led เสร็จสิ้นการติดตั้ง Board ESP8266 ต่อมาเรามาเขียนโปรแกรมแรกกัน คือโปรแกรม ไฟกระพริบ(Blink LED) เริ่มแรก เสียบ NodeMcu เข้ากับ Computer

Image

blink-led เข้าโปรแกรม Arduino IDE แล้วเปิดตัวอย่างโปรแกรมโดยเข้าที่ File—>Examples—>esp8266—>Blink

Image

blink-led จะพบกับตัวอย่าง Code ให้เรา compile(หมายเลข 1) แล้วโปรแกรมลง ESP8266(หมายเลข 2) ได้เลยครับ

Image

blink-led เมื่อโปรแกรมลง ESP8266 เสร็จแล้ว ไฟ LED บน board จะกระพริบ ดูวีดีโอตัวอย่างผลลัพธ์

Suggestion blogs

Go EP.4 Syntax ของภาษา Go

สวัสดีครับ ในบทความนี้ก็เป็น EP.4 แล้วนะครับ โดยเนื้อหาจะเป็นเรื่องเกี่ยวกับ Syntax ของภาษา Go ว่าภาษา Go มีรูปแบบการเขียนเป็นอย่างไร แต่ละคําสั่งใช้อย่างไรสําหรับท่านใดที่ยังไม่ได้อ่าน EP.3 ท่านสามารถกลับไปอ่านก่อนได้นะครับที่นี่ Go EP.3 Go packages คืออะไรมาเริ่มเรียนรู้ไปด้วยกันตามหัวข้อด้านล่างเลยครับ

แก้ปัญหา Preset ใน Premiere Pro CS6 ไม่ครบ

กรณีที่เราลง Adobe Premiere Pro CS6 หลังจาก Crack แล้ว เมื่อเปิดโปรแกรมขึ้นมาใช้งาน Preset จะขึ้นไม่ครบ HDV ไม่ขึ้น ดังรูป

HTTPS (SSL) wordpress config

วิธีการทำให้ wordpress support https (ssl) มีขั้นตอนดังนี้ เข้าไปที่ Admin-->Setting-->General Setting เปลี่ยน WordPress Address (URL) และ Site Address (URL) เป็น https


Copyright © 2019 - 2026 thiti.dev |  v1.61.0 |  Privacy policy | 

Build with ❤️ and Astro.

Github profile   Linkedin profile   Instagram   X profile   Nostr   Youtube channel   Telegram   Email contact   วงแหวนเว็บ