[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] 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] ESP Class

This article is a detailed look at the ESP.h file of esp8266 Arduino to learn the functions that are very useful for programming to control the operation of this microcontroller such as knowing the amount of memory remaining or the largest memory size that can be reserved. This is used if you want to write a program that uses dynamic memory to store a list of all found APs, for example, programmers can use this class directly from the ESP object.

Read More

[TH] How to render the Thai string correctly?

จากบทความการใช้งาน u8g2 ที่สามารถเรนเดอร์ (Render) ภาษาไทย (Thai string) ได้ผ่านทางฟังก์ชัน drawUTF8() ของไลบรารี u8g2 แต่การแสดงผลไม่ถูกต้อง ดังภาพที่ 1 ด้วยเหตุนี้จึงต้องปรับปรุงโค้ดของไลบรารีเพิ่มเติมเพื่อให้การแสดงผลถูกต้องดังภาพที่ 2

ภาพที่ 1 การแสดงผลของ drawUTF8() ก่อนปรับปรุง
ภาพที่ 2 การแสดงผลของ drawUTF8() หลังปรับปรุง
Read More

[EN] ESP8266 WebServer

This article is an experiment to make the esp8266 microcontroller a web server to display temperature and humidity values from a DHT11 sensor using the Adafruit library as shown in Figure 1. When the microcontroller is run in SoftAP mode, the client or user connects to WiFi after using the browser to access 192.168.4.1 which is the IP of esp8266.

(Figure. 1 Our equipment)
Read More

[EN] ESP-01s + Relay

This article is an application of the ESP-01s module connected to the ESP-01/01s Relay v4.0 as shown in Figure 1 to enable the relay to work. The example program is to turn the relay on and off via a web browser, which has been mentioned in some WebServer articles, but in addition to catching URLs for arguments to work.

(Figure. 1 ESP-01s + Relay)
Read More