[EN] PyGlet

pyglet is a Python library to create windows and cross-platform multimedia on Windows (Windows), MacOS (macOS) and Linux (Linux) for developing games or visualization applications. The library itself supports creating windows, integration with users through an event-based system, support OpenGL graphics, image/video loading support, and playing music. This article discusses installing and using pyglet on Raspberry Pi 3 B+ and Raspberry Pi 4 as a test device.

(Figure. 1 Example from 1-6)
Read More

[TH] Arduino: STM32L432 Nucleo-32’s DAC&ADC.

จากที่ได้อ่านบทความ การใช้งาน STM32 Core Support for Arduino สำหรับบอร์ด Nucleo L432KC ของอาจารย์ เรวัต ศิริโภคาภิรมย์ ทางเราเลยได้จัดหาบอร์ดมาทดลองใช้งานและเชื่อมต่อขาสำหรับส่งข้อมูลออก DAC ไปยัง ADC ตามภาพที่ 1 เพื่อทดสอบการทำงานของภาค DAC และ ADC ของบอร์ดโดยใช้โค้ดการทำงานเหมือนกับบอร์ดไมโครคอนโทรลเลอร์ ESP32, SAM-D21 และ LGT8F328P ว่าเป็นอย่างไร มาติดตามกันครับ

ภาพที่ 1 บอร์ด Neucleo L432KC เชื่อมต่อขา A3 เข้ากับ D3
Read More

[TH] Blender : Low Poly Man

บทความนี้เป็นบันทึกขั้นตอนการขึ้นรูปคนแบบโพลีกอนน้อยด้วยโปรแกรม Blender ซึ่งเป็นซอฟต์แวร์แบบแจกจ่ายฟรี และเปิดเผยโค้ด ปัจจุบันเป็นรุ่น 2.93.6 LTS โดยเริ่มต้นจากกล่องแล้วตัดฝั่งซ้ายออกไป หลังจากนั้นใช้ Modifier แบบ Mirror เพื่อให้ฝั่งซ้ายและขวาเหมือนกัน ทำให้ปรับแก้เฉกาะฝั่งขวาทำให้งฝั่งซ้ายมีผลตามไปด้วย หลังจากนั้นจัดรูปทรงให้เป็นตามภาพที่ 1

ภาพที่ 1 ขึ้นรูปจากบริเวณลำตัว
Read More

[TH] Arduino: The LGT8F328P’s ADC/DAC.

บทความนี้เป็นบทความที่ต่อเนื่องจากบทความแนะนำบอร์ด LGT8F328P และการใช้ ADC และ DAC ในก่อนหน้านี้ โดยเน้นที่การใช้งานสำหรับชิพ LGT8F328P เป็นหลัก โดยการใช้งานนั้นจะแตกต่างจาก SAM-D21 ตรงที่ ใช้ขา D4 เป็นขาที่ทำหน้าที่ DAC0 และวงจร DAC มีความละเอียดในการทำงานระดับ 8 บิต หรือส่งออกค่าได้ตั้งแต่ 0 ถึง 255 ส่วนภาค ADC นั้นใช้ขา A0, A1, … ได้ตามปกติ และมีความละเอียดในการทำงาน 12 บิต ดังนั้น ในบทความนี้จึงใช้การเชื่อมต่อขาจาก A0 เข้ากับ D4 ในการทดลองดังภาพที่ 1

ภาพที่ 1 บอร์ด LGT8F328P เชื่อมต่อขา A0 เข้ากับ D4
Read More

[EN] u8g2 Library

From the article on using the ESP8266 with an OLED graphical display written in Python, you’ll find that it’s fast and easy but when used with other microcontrollers that cannot use Micropython or CircuitPython, what must be done? One of the many options is the u8glib or u8g2 (Universal 8 bit Graphics Library) libraries, designed to work with monochromatic 8-bit graphics over either I2C or SPI communication. In this article, we are using I2C OLED as shown in Figure 1.

(Figure. 1 STM32F401CCU6 with I2C OLED)
Read More

[TH] Arduino ADC/DAC

บทความนี้แนะนำบอร์ดไมโครคอนโทรลเลอร์ ESP32 และ SAM-D21 มาใช้งานเพื่อเรียนรู้การใช้คำสั่งเกี่ยวกับ ADC (Analog to Digital Converter) และ DAC (Digital to Analog Converter) ด้วยการเชื่อมต่อขา DAC เข้ากับ ADC ดังตัวอย่างภาพที่ 1 (เชื่อม A0 เข้า A1 ของบอร์ด SAM-D21) และ 2 (เชื่อมต่อขา GPIO26 เข้ากับ GPIO36 ของ ESP32) เพื่อส่งข้อมูลที่ไป DAC และให้ ADC อ่านค่ากลับเข้ามา และส่งผลลัพธ์ออกไปที่พอร์ตอนุกรมสำหรับแสดงผลด้วย Serial Plotter ซึ่งตัวอย่างโปรแกรมสั่งส่งข้อมูล 3 แบบ คือ กราฟแบบฟันปลา กราฟแบบสามเหลี่ยม และกราฟรูปคลื่นจากฟังก์ชันไซน์

ภาพที่ 1 บอร์ด SAM-D21 เชื่อมต่อขา A0 เข้ากับ A1
ภาพที่ 2 บอร์ด ESP32 ที่เชื่อมต่อขา 26 เข้ากับ 36
Read More

[TH] Cortex-M0+: SAMD21

บทความนี้แนะนำบอร์ดไมโครคอนโทรลเลอร์ที่ใช้ชิพ ATSAMD21G18 ของบริษัท Microchip ที่ใช้สถาปัตยกรรม ARM แบบ 32 บิต แกนตระกูล Cortex-M0+ ในรูปแบบบอร์ดตามตระกูล Arduino Uno ดังภาพที่ 1

ภาพที่ 1 บอร์ด SAMD21 ในฟอร์มของ Arduino Uno
Read More

[EN] ulab v3.0

From the previous ulab article, it was found that Micropython can implement the same dataset processing instructions as used in Numpy through the previous ulab library v.0.54.0 which is the older version of ulab (currently v.3.0.1) brought up this article. This article describes how to create a Micropython that integrates the ulab library and uses it with SPIRAM versions of esp32.

(Figure. 1 Module list of ulab)

ulab3

From Figure 1, it can be seen that the structure of the ulab library has changed from the original. This causes the programming from the previous example to have to be modified. Under ulab there are libraries of numpy and scipy. The details of numpy that are supported are as follows.

Read More