บทความ

แก้ปัญหา ภาษา keyboard layout ใน windows 10

 .. แก้ regedit ref: https://superuser.com/questions/957552/how-to-delete-a-keyboard-layout-in-windows-10 Use regedit to navigate to following registry keys, where you will find there the list of keyboards that are preloaded at boot. HKEY_USERS\.DEFAULT\Keyboard Layout\Preload HKEY_CURRENT_USER\Keyboard Layout\Preload HKEY_USERS\.DEFAULT\Control Panel\International\User Profile HKEY_USERS\.DEFAULT\Control Panel\International\User Profile System Backup รหัส reg/layout ref: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-language-pack-default-values?view=windows-11 .

ESP32 KeyPad

 .. ชลิตา จูมสีมา : เขียน Library: https://github.com/Chris--A/Keypad ตัวอย่างโค้ด:  #include <Keypad.h> const byte ROWS = 4; //four rows const byte COLS = 4; //three columns char keys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'} }; byte rowPins[ROWS] = {13, 12, 14, 27}; //connect to the row pinouts of the keypad byte colPins[COLS] = {26, 25, 33, 32}; //connect to the column pinouts of the keypad Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); void setup(){ Serial.begin(115200); } void loop(){ char key = keypad.getKey(); if (key){ Serial.print(key); } } ..

การใช้ KidBright RTC Module ใน Arduino IDE

รูปภาพ
 .. Step 1. โหลด RTC Lib แล้วติดตั้ง (บอร์ด kidbright ใช้ rtc chip เบอร์ : MCP79412RTC) https://github.com/ichilton/mcp7941x_arduino    >>  แนะนำจากเอกสาร nectec แต่ตัวนี้อ่านค่าขึ้นมาไม่ได้เลย https://github.com/JChristensen/MCP79412RTC   >>  Lib นี้ อ่านค่าได้ แต่บันทึกแล้วไม่จำ, sync ไม่ติด https://github.com/stevemarple/RTCx  >> ทดลองแล้ว ใช้งานได้จริงกับบอร์ด kidbright Step 2. โหลด TimeLib แล้วติดตั้ง (ไม่จำเป็น) https://github.com/PaulStoffregen/Time Step 3. รันโค้ดตัวอย่างใน RTC Lib; เมื่อคอมไพล์เสจ็จ เปิดดูผลลัพธ์ได้จาก Serial Monitor จะพบผลลัพธ์ดังภาพ ...

ติดตั้งบอร์ด Microbit V1 ใน Arduino IDE V2

รูปภาพ
  .. ชลิตา จูมสีมา : เขียน/เรียบเรียง ** จากการทดสอบ บอร์ด Microbit V2 ยังมีปัญหา อัพโหลดไม่ได้ Step 1. ที่โปรแกรม IDE เลือก file > Preference Step 2. ที่ Additional boards manager URL เพิ่ม (1 บรรทัดต่อ 1 Link กรณีติดตั้งบอร์ดอื่นๆด้วย เช่น บอร์ด microbit, sparkfun, ...) https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json Step 3. คลิกที่ Boards Manager แล้วพิมพ์คำว่า nrf5 ในช่องค้นหา เลือก Nordic Semiconductor nRF5 Boards By Sandeep Mistry แล้วทำการติดตั้ง (ต้องเชื่อมต่อ Internet) Step 4. เลือกบอร์ดโดยคลิกที่ Select other board and port...  Step 5. ที่ช่องค้นหา พิมพ์ microbit จากนั้นเลือกรุ่นบอร์ดและ port ที่เชื่อมต่อกับบอร์ด Microbit Step 6. ทดลองเขียนโค้ดดังนี้ แล้วคลิปปุ่ม upload (เมื่อขึ้น uploading ต้องกดปุ่ม boot บนตัวบอร์ด)  const int buttonA = 5; const int buttonB = 11; void setup() { Serial.begin(9600); pinMode(buttonA, INPUT); pinMode(buttonB, INPUT); } void loop() { if (! digitalRead(buttonA)) { Serial.pri...

ติดตั้งบอร์ด ESP32 ใน Arduino IDE v2

รูปภาพ
 .. ชลิตา จูมสีมา : เขียน/เรียบเรียง Step 1. ที่โปรแกรม IDE เลือก file > Preference Step 2. ที่ Additional boards manager URL เพิ่ม (1 บรรทัดต่อ 1 Link กรณีติดตั้งบอร์ดอื่นๆด้วย เช่น บอร์ด microbit, sparkfun, ...) https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json Step 3. คลิกที่ Boards Manager แล้วพิมพ์คำว่า esp32 ในช่องค้นหา เลือก esp32 by Espressif Systems แล้วทำการติดตั้ง (ต้องเชื่อมต่อ Internet) Step 4. เลือกบอร์ดโดยคลิกที่ Select other board and port...  Step 5. ที่ช่องค้นหา พิมพ์หาชื่อบอร์ดที่ต้องการ จากนั้นเลือกรุ่นบอร์ดและ port ที่เชื่อมต่อกับบอร์ด ESP32 Step 6. ทดลองเขียนโค้ดดังนี้ แล้วคลิปปุ่ม upload (เมื่อขึ้น uploading ต้องกดปุ่ม boot บนตัวบอร์ด)  void setup() { Serial.begin(9600); Serial.println("Hi, It's working"); } void loop() { } Step 7. เมื่อ upload แล้ว ให้เปิดหน้าต่าง Serial Monitor จากนั้นปรับ baud rate ไปที่ 9600 แล้วกดปุ่ม Reset ที่ตัวบอร์ดเพื่อดูผลลัพธ์ ..

ZF4 (Laminas) : การใช้ Logger เพื่อเขียนลงไฟล์

 .. Step 1. composer require laminas/laminas-log Step 2. Logger Config.  $stream = @fopen(dirname(__FILE__) . "/../../../data/log/ssgs.log", 'a', false); if (!$stream) { throw new Exception('Failed to open stream'); } $writer = new \Laminas\Log\Writer\Stream($stream); $log = new \Laminas\Log\Logger(); $log->addWriter($writer); Step 3. การใช้งาน. log->info('Informational message'); ชลิตา จูมสึมา : เรียบเรียง/เขียน Ref 1: https://docs.laminas.dev/laminas-log/intro/ ..

PHP 8 : ปัญหาที่ยังไม่ควรเปลี่ยนมาใช้

รูปภาพ
 .. 1. unlink() กับตัวแปร String ไม่เจอไฟล์ PHP8.2 ใน xampp ทำงานได้ปกติแล้ว!! แต่ถ้าเปลี่ยนมาเป็น String  แล้วเติม backslash เอาเองเช่น "c:\\chalita\\narak" ทำงานได้ 2. xdebug ติดตั้่งได้ เจอ module ใน phpInfo( ) แต่ไม่แสดงผลในหน้า page (ถ้าทำงานต้องเห็นสีส้ม) (ใน php8.2 ubuntu ต้องกำหนดคำสั่ง force error เอาเอง) PHP8.2 ใน xampp ทำงานได้ปกติแล้ว!! ชลิตา จูมสีมา : เรียบเรียง/เขียน ..