[EN] Try the SoftHost USB library for ESP32.

This article is an example of using nathalis‘s ESP32 Soft Host to try and test it on an OLED display with a resolution of 128×64 dots as shown in Figure 1 to receive data from a keyboard or mouse, it uses only a few GPIO pins but receives data from a keyboard with a large number of keys. Normally, the ESP32 microcontroller does not support a direct USB connection, so it requires programming by using a timer to check the status of the pins D- and D+ to be assembled into data at the byte level and assembled into packs of data for further interpretation.

Figure 1 Connected devices and boards are illustrated in this article
Read More

[TH] Try the SoftHost USB library for ESP32.

บทความนี้เป็นตัวอย่างการนำ ESP32 Soft Host ของ nathalis มาทดลองใช้งานและทดลองแสดงผลที่จอแสดงผล OLED ที่มีความละเอียด 128×64 จุด ดังภาพที่ 1 เพื่อรับข้อมูลจากแป้นพิมพ์ หรือเมาส์ ทำให้ใช้ GPIO เพียงไม่กี่ขาแต่สามารถรับข้อมูลจากแป้นพิมพ์ที่มีจำนวนปุ่มที่เยอะได้ ซึ่งโดยปกติแล้วตัวไมโครคอนโทรลเลอร์ ESP32 ไม่รองรับการทำเชื่อมต่อกับ USB โดยตรงจึงต้องอาศัยการเขียนโปรแกรมด้วยการใช้ตัวตั้งเวลาหรือ Timer มาตรวจสอบสถานะของสายสัญญาณขา D- และ D+ เพื่อนำมาประกอบกันเป็นข้อมูลในระดับไบต์และนำมาประกอบกันเป็นแพ็คของข้อมูลเพื่อทำการตีความต่อไป

ภาพที่ 1 อุปกรณ์และบอร์ดที่เชื่อมต่อกันเพื่อเป็นตัวอย่างในบทความนี้
Read More