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

In the previous article, we have read the list of devices connected to the serial port of the Raspberry Pi board or RPi with the pySerial library in text mode as shown in Figure 1. This article combines the previous working principles with the use of a graphical user interface via the PyQt5 library, listed in the combobox for users to choose from. If no serial port connected to the board is found, the RPi disables the combobox from user selection. Therefore, this article discusses the implementation of pySerial with the QLabel and QComboBox libraries. PyQt5.

Read More

[TH] LEDs on/off via PyQt5 and serial communication.

ในบทความนี้ใช้ความรู้จากบทความการอ่านรายชื่อพอร์ตอนุกรมที่ถูกเชื่อมต่อมาปรับปรุงให้เป็นการส่งข้อมูลส่งไปให้บอร์ด Arduino Uno ที่มีหลอดแอลอีดี (LED) เชื่อมต่ออยู่ที่ขา 2,3,4,5,6,7,8 และ 9 ทำให้ผู้ใช้งานสามารถสั่งเปิดหรือปิดหลอดดังกล่าวด้วยการสั่งงานผ่าน GUI (Graphics User Interface) ของ PyQt5 ดังภาพที่ 1 และส่งข้อมูลไปให้บอร์ด Uno ทางพอร์ตสื่อสารอนุกรมด้วย pySerial โดยในตัวอย่างครั้งนี้ การทำงานรองรับทั้งระบบปฏิบัติการ Windows, macOS และ Linux ซึ่งจะทำให้เห็นว่า PyQt5 และ pySerial สามารถรองรการทำงานกับทั้ง 3 ระบบได้

Read More

[TH] List the serial ports connected to the RPi with pySerial and PyQt5.

จากบทความก่อหน้านี้เราได้อ่านรายชื่ออุปกรณ์ที่เชื่อมต่อกับพอร์ตอนุกรมของบอร์ด Raspberry Pi หรือ RPi ด้วยไลบรารี pySerial ดังภาพที่ 1 ในแบบโหมดตัวอักษรไปแล้ว ในบทความนี้เป็นการผนวกหลักการทำงานจากก่อนหน้าเข้ากับการใช้ส่วนติดต่อกับผู้ใช้แบบกราฟิกส์ หรือ GUI (Graphics User Interface) ผ่านทางไลบรารี PyQt5 โดยแสดงรายการเอาไว้ใน combobox เพื่อให้ผู้ใช้งานเลือกใช้งานได้ แต่ถ้าไม่พบพอร์ตสื่อสารอนุกรมที่เชื่อมต่อกับบอร์ด RPi จะปิดการใช้งานของ combobox ไม่ให้ผู้ใช้งานเลือกใช้งาน ดังนั้น บทความนี้จึงมีเนื้อหาเกี่ยวกับการประยุกต์ใช้ pySerial กับการใช้งานของ QLabel และ QComboBox ในไลบรารี PyQt5

Read More

[EN] PyQt5

This article provides an example of opening a window and using a button in response to PyQt5, which is the basis for using the other components. The highlight of Qt is that it is a cross-platform C++ development kit and covers the integration for compatibility with languages such as PyQt, “The python binding for the Qt cross-platform C++ framework” developed by Riverbank Computing Limited, currently released in PyQt 6.1.1 (2021-06-29).

Read More

[TH] PyQt5

บทความนี้เป็นตัวอย่างการเปิดหน้าต่างและใช้ปุ่มเพื่อตอบสนอง PyQt5 ซึ่งเป็นพื้นฐานเบื้องต้นของการใช้คอมโพเนนท์อื่น ๆ ต่อไป โดยจุดเด่นของ Qt คือ เป็นชุดพัฒนาภาษา C++ ที่ข้ามแพล็ตฟอร์มและมีการครอบการเชื่อมผสานเพื่อใช้กับภาษาต่าง ๆ ได้ เช่น PyQt อันเป็น “The python binding for the Qt cross-platform C++ framework” ที่พัฒนาโดย Riverbank Computing Limited ซึ่งปัจจุบันออกรุ่น PyQt 6.1.1 (2021-06-29)

Read More