[TH] Understand and use the ESP32-C3

หลังจากที่พวกเราใช้งาน  esp8266 โดยเฉพาะโมดูล esp-01 และ esp-01s เพื่อเป็นตัวบริหารจัดการเครือข่ายเซ็นเซอร์มาเป็นระยะเวลาพอสมควร และด้วยขีดจำกัดในเรื่องของจำนวนขาใช้งานทำให้ต้องออกแบบระบบให้ทำงานคู่กับ  STM32F103C8T6 หรือ STM32F401CCU6/STM32F411CEU6 เพื่อให้การทำงานมีความสเถียรไม่ประสบปัญหาเกี่ยวกับ WDT ของ esp8266 และด้วยเวลาที่ผ่านไป ทาง espressif ออกไมโครคอนโทรลเลอร์ตามมาอีกหลายตัว เช่น esp32, esp32-s2, esp32-c3 และ esp32-s3

ทางเราได้ทดสอบและใช้งาน esp32 จนแทบจะเป็นตัวหลักในการทำงาน จน esp32-s2 กับบอร์ดของ LILYGO ทำให้เราลองสั่งมาใช้งาน ปัญหาหลักอยู่ที่เครื่องมือในการพัฒนานั้นออกมาล่าช้ามาก แต่อย่างไรก็ดี ณ​ ตอนนี้ทาง espressif ได้ออกชุดพัฒนาสำหรับ Arduino หรือ Arduino Core for ESP32 รุ่น 2.0 พร้อมรองรับการใช้กับ esp32 esp32-s2 และ esp32c3 ทำให้การใช้งานกับ ESP32 และ ESP32-S2 ใช้งานได้ดี และล่าสุดทางทีมงานเราได้บอร์ด esp-c3-32s มาจึงเกิดมาเป็นบทความนี้

สำหรับบทความนี้เป็นการเรียบเรียงจาก datasheet ของ ESP32-C3 WROOM-02 ซึ่งในบทความนี้เราใช้บอร์ดดังภาพที่ 1 ส่วนตัวอย่างโปรแกรมเป็นการขับหลอด LED แบบ RGB บนบอร์ดให้ทำงานโดยใช้ Arduino Core for ESP32 และ ESP-IDF ที่ปรับปรุงมาจากบทความใน Ep.3

ภาพที่ 1 บอร์ดไมโครคอนโทรลเลอร์ ESP32-C3
Read More

[EN] Arduino : repetition

Programming is an instruction for the processor to execute an instruction received. At a time, there is one instruction to process (in the case of non-parallel processing), once the instruction is completed, it saves the results of the commands in the working status register and prepares the next commands to be executed. This allows the operation to be performed individually from the first statement to the next, and the programmer can place the condition to separate the execution, for example, when a condition is true some instruction will be executed or any condition is not true, do not have to do or do something, etc. And finally, the function of the program can be repeated by the condition of iteration. For this reason, the basic programming principles consist of 3 types of work:

  • Execute one command at a time from top to bottom.
  • Able to add conditions of order processing.
  • Able to repeat the desired command.
Read More

[TH] ESP-NOW

บทความกล่าวถึงการใช้การสื่อสารที่ทาง espressif พัฒนาเพื่อใช้ในการสื่อสารระหว่างไมโครคอนโทรลเลอร์ของตนเองผ่านทางการสื่อสารไร้สายซึ่งเป็นอีกทางเลือกหนึ่งของการพัฒนาระบบแบบ Client/Server โดยอธิบายขั้นตอนการทำงานของการทำงานเป็นผู้ให้บริการ ผู้สั่งการ และชุดคำสั่งที่เกี่ยวข้องผ่านทาง Arduino core พร้อมอธิบายตัวอย่างการทำงานที่มากับ Arduino core ทั้ง 2 ตัวอย่าง คือ basic และ Multi-slave ซึ่งสามารถนำไปประยุกต์ใช้งานได้หลากหลาย

Read More

[TH] ESP-IDF Ep.3 : GPIO Output

บทความนี้กล่าวถึงการตั้งค่า GPIO และการส่งสถานะดิจิทัล 0 หรือ 1 ไปยังพอร์ต โดยเริ่มจากการสั่งให้หลอดแอลอีดีสว่างและดับ โดยเชื่อมต่อกับวงจรแอลอีดีภายนอกบอร์ดดังภาพที่ 1

ภาพที่ 1 การทดลองขับหลอดแอลอีดีจาก esp32
Read More

[EN] Arduino : condition

This article describes how to use a set of condition check statements to create programming alternatives. C++ programming uses the { and } symbols for each block of action that means the instruction set in each block is always executed from top to bottom, with one action at a time, and can be executed by creating a condition. In addition, the desired part of the command can also be repeated by loop, which will be discussed in the next article.

Read More

[TH] ST7735s

บทความนี้กล่าวถึงการตั้งค่าไลบรารี TFT_eSPI ของ Arduino เพื่อใช้งาน TFT LCD ที่ควบคุมด้วยชิพ ST7735s ที่ได้เคยเขียนเป็นตัวอย่างในบทความก่อนหน้านี้ด้วยภาษาไพธอน แต่จากการใช้งานของทีมงานเราพบว่า ST7735s ที่เป็น LCD IPS ขนาด 0.96″ นั้นมี 2 รุ่น ซึ่งเป็น GREENTAB160x80 กับ REDTAB160x80 โดยโมดูลทั้ง 2 ประเภทแตกต่างกันที่การเว้นวรรคช่องว่างระหว่างกันดังภาพที่ 1 ซึ่งในบทความนี้ใช้ ESP8266, ESP32 รุ่น DO-IT DevKit กับ ESP32CAM และ STM32F103C8T6 เป็นบอร์ดทดสอบการทำงานของโปรแกรม

ภาพที่ 1 โมดูลแสดงผล TFT ขนาด 0.96″ แบบ IPS
Read More

[TH] MicroPython : PWM

บทความนี้กล่าวถึงการใช้ PWM หรือ Pulse Width Modulation ที่เป็นโมดูลภายใต้คลาส machine ของ MicroPython เพื่อใช้งานกับ esp8266 และ esp32 พร้อมตัวอย่างการใช้ PWM ในการหรี่ความสว่างของหลอดแอลอีดี และการสร้างความถี่เสียงด้วย PWM ซึ่งสามารถนำไปประยุกต์ใช้ได้ต่อไป

Read More

[TH] ปรับแต่งไลบรารี st7735 blue-tab/red-tab 0.96 นิ้ว

บทความนี้เป็นการปรับปรุงไฟล์ไลบรารี st7735 สำหรับ Micropythonโดย Billy Cheung (เข้าถึงเมื่อ 2021-09-07) ที่เผยแพร่บน github ซึ่งเป็นไลบรารีที่ปรับปรุงมาจาก Guy Caver จนรองรับ ST7735s โดยไลบรารีที่ต้องใช้งานประกอบด้วย st7735.py และ sysfont.py Guy Carver ใช้งานกับ esp8266 และ esp32 เพื่อให้ความเร็วในการแสดงผลที่ดีขึ้นโดยอาศัยหลักการสร้างบัฟเฟอร์ของการแสดงผลสำหรับเก็บข้อมูลพิกเซลและเพิ่มเติมคำสั่งสำหรับส่งข้อมูลจากบัฟเฟอร์ไปยังโมดูล TFT ผ่านบัสแบบ SPI

ภาพที่ 1 บอร์ด dCore-miniML ที่ติดตั้งโมดูลแสดงผล ST7735 0.96 นิ้ว
Read More

[EN] Arduino: Expression

An expression is a combination of operands and operators. An expression can be nested. However, programming principles differ from mathematics. For this reason, the conversion of an expression from a mathematical equation to an expression in a programming language requires a procedure to translate the correct sequence of calculations to prevent errors in calculations such as

Read More