[EN] LittleFS Filesystem

The article discusses the use of the LittleFS library and introduces a library developed for use with the esp32 microcontroller, which includes a plugin for the Arduino IDE for uploading files to the microcontroller’s ROM. Make it convenient to load data to store and run. For this reason, if programmers find it difficult to transcode HTML/CSS/JavaScript to be a string manually and switching to uploading files to esp32 and reading the web files directly to use will be something that will require training to use LittleFS as a reliable library.


Read More

[TH] Into 3d printing

จากบทความก่อนๆ ทุกท่านคงจะทราบดีว่าทางทีมงานได้ทดลองเกี่ยวกับ Microcontroller รวมถึงการสร้างเกม แต่นอกจากนั้นทางทีมงานยังได้ทดลองเกี่ยวกับการพิมพ์ 3 มิติด้วย โดยในบทความนี้จะพูดคุยเกี่ยวกับการพิมพ์ 3 มิติ โดยมีรายละเอียดพอสังเขป

ภาพที่ 1 ที่วางแก้วแบบปรับสมดุลจากการพิมพ์ 3 มิติ
Read More

[EN] Binary Search Tree data structure programming with Python.

In the previous article, programming to implement queue-based data structures was introduced. In this article, we introduce programming to manage another type of data structure which has different storage and management methods called BST tree or Binary Search Tree, as shown in Figure 1, which is a structure that can be applied to data collection with attributes in which the data in the left branch is less than itself and the right branch is greater than itself or the opposite, i.e. the left branch has a greater value and the right branch is less. It enables searching for data in cases where the tree is balanced on the left and right in the BST structure, saving half the time or number of search times per round of available data, e.g. 100 data sets in the first round if it is not the information you are looking for will be left with a choice to find from the left or right branches which the selection causes the information of the other side is not considered or cut off approximately half. However, if the Binary Search Tree is out of balance, the search speed is not much different from the sequential search.

In this article, we use Python that works on either a Python 3 or MicroPython interpreter to store the data, adding information ,searching for information as an example of further development.

BST : Binary Search Tree
Figure 1 BST
Read More

[TH] Queue data structure with array and Singly Linked List.

บทความนี้เป็นการอธิบายเกี่ยวกับโครงสร้างข้อมูลแบบคิว (Queue) ซึ่งได้เคยเขียนถึงไปในบทความ Queue Data Structure ที่เป็นภาษาไพธอนและถูกนำไปใช้บ่อยกับตัวอย่างของ MicroPython แต่บทความนี้เป็นภาษา C ที่เขียนผ่าน Arduino IDE เพื่อใช้งานกับบอร์ดไมโครคอนโทรลเลอร์ LGT8F328P, SAM-D21, ESP8266, ESP32 และ ESP32-S2 ดังภาพที่ 1 โดยยกตัวอย่างการนำโครงสร้างแถวลำดับ และลิงค์ลิสต์เดี่ยวมาเป็นโครงสร้างข้อมูลแบบคิว และคงเป็นบทความสุดท้ายบน JarutEx แล้วครับ

ภาพที่ 1 บอร์ดไมโครคอนโทรลเลอร์ ESP32-S2, LGY8P326P และ SAM-D21
Read More

[EN] List the serial ports connected to the RPi with pySerial.

This article discusses the use of Python language pySerial library on Raspberry Pi or RPi both 3rd and 4th generation to connect to the serial port. It can be done in 2 ways, the first is to use hardware like ET-CONV10/RS232 HAT that has been written in the book and with the use of a USB port connected to a converter to be a serial communication port (USB to Serial Port) as shown in Figure 1. This article uses the second method to run pySerial to check how many serial ports are connected and what are their names as an example in Figure 8.

Figure 1 Connect ET-USB/RS232 Mini to RPi’s USB
Read More

[TH] Stack data structure with Singly Linked List.

บทความนี้เป็นการอธิบายเกี่ยวกับโครงสร้างข้อมูลแบบสแต็ก (Stack) เพื่อเขียนโปรแกรมด้วยภาษา C บนแพล็ตฟอร์มต่าง ๆ โดยใช้โครงสร้างข้อมูลแบบลิงค์ลิสต์เดี่ยวเป็นที่เก็บข้อมูลของสแต็กพร้อมตัวอย่างการแถวลำดับเป็นที่เก็บข้อมูล และทดสอบการทำงานกับบอร์ดไมโครคอนโทรลเลอร์ LGT8F328P, SAM-D21, ESP8266, ESP32 และ ESP32-S2 ดังภาพที่ 1 และ 2 ส่วนกรณีที่ต้องการไปใช้กับแพล็ตฟอร์มอื่น ๆ ยังคงสามารถดัดแปลงโค้ดเพื่อนำไปใช้ได้เช่นเดียวกัน

ภาพที่ 1 บอร์ดไมโครคอนโทรลเลอร์ ESP32, LGY8P326P และ SAM-D21
Read More

[TH] Arduino: Using the ST7735s module with an ESP32-S2 via the TFT_eSPI library.

บทความนี้เป็นการใช้โมดูล ST7735s กับไมโครคอนโทรลเลอร์ ESP32-S2 ผ่านไลบรารี TFT_eSPI โดยในก่อนหน้านี้ได้กล่าวถึงการใช้งานกับไมโครคอนโทรลเลอร์ ESP32 และ STM32F103C ไปแล้ว และโมดูล TFT ที่เลือกใช้เป็น REDTAB80x160 (ได้เพิ่มเติมโค้ดสำหรับ GREENTAB80x160 ในตอนท้ายบทความ) แต่สามารถปรับดารตั้งค่าเป็นโมดูลอื่น ๆ ได้ โดยดูรายละเอียดจากไฟล์ User_Setup.h ของไลบรารี TFT_eSPI ดังภาพที่ 1

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

[EN] How to build MicroPython for esp32-s2.

This article discusses compiling and using MicroPython for an esp32-s2 microcontroller based on the TTGO ESP32-S2 V1.1 or TTGO ESP32-S2-WOOR V1.1 board with a Type-C USB port and supports operation via CH340C and OTG by using a dip switch as shown in Figure 1, enabling MicroPython to be used because the chip program uses the CH340’s circuit programming and Python programming requires a port that works like OTG

TTGO ESP32-S2 V1.1
Figure 1 TTGO ESP32-S2 V1.1
Read More

[TH] Arduino: ควบคุมการเคลื่อนที่หุ่นยนต์รถผ่านบราวเซอร์ด้วย esp8266 Part 2

จากบทความก่อนหน้าที่ใช้ esp8266 เพียงตัวเดียวสำหรับการควบคุม Agent ซึ่งจำนวนขาที่ไมโครคอนโทรลเลอร์ esp8266 (ตามที่เขียนไว้ในบทความเกี่ยวกับ machine.Pin ของ MicroPython) มีให้นั้นมีจำกัด และหลายขาถูกใช้งานขณะเริ่มระบบทำให้เกิดความผิดพลาดที่ไม่ได้ตั้งใจ เช่น ล้อหมุนเมื่อระบบเริ่มทำงาน และหยุดเมื่อระบบทำการบูตเสร็จ เป็นต้น ดังนั้น ในบทความนี้จึงเพิ่มบอร์ดไมโครคอนโทรลเลอร์ LGT8F328P เข้ามา ดังภาพที่ 1 หรือผู้อ่านอาจจะเปลี่ยนเป็นไมโครคอนโทรลเลอร์ตระกูล Arduino อื่น ๆ แทนได้ เช่น Arduino Nano หรือ Arduino Uno เป็นต้น โดยให้ LGT8F328P นั้นเป็นส่วนของ Actuator ที่ทำหน้าที่เคลื่อนที่ไปในสิ่งแวดล้อม คือ สามารถสั่งให้เดินหน้า ถอยหลัง เลี้ยวซ้าย เลี้ยวขวา และหยุดได้ ทำให้ลดภาระการทำงานของ esp8266 ลง และให้ทำงานตอบสนองการสื่อสาร WiFi ได้มากขึ้น

ภาพที่ 1 บอร์ด LGT8F328P ที่นำมาประกอบเข้ากับระบบหุ่นยนต์รถเพื่อใช้ควบคุมการเคลื่อนที่
Read More