Skip to main content

Posts

Showing posts from October, 2018

Arduino I2c Scanner

Arduino I2C Scanner This article Is trick  about  serial connection on  I2C-Bus in Arduino Board.  Because of the time on develop software associated  I2C device, the device may not respond. So i t can not be said that the problem is that the i2c device or develop a program. Advantages of I2C Scanner Find the Address of I2C Device. Check responds of I2C device. * If found I2C Device Address, It can used to program the Arduino board. * If not found  I2C Device Address,  Check the jumper cable (if  jumper cable are  Correct  Device may be  cracked .) Example Program Examples Circuit use Real Time Clock (DS1307) and 16x2 LCD I2C i2c scanner Program Referent     - https://playground.arduino.cc/Main/I2cScanner

Arduino สแกน I2C Adress

Arduino สแกน I2C Address         สำหรับบทความนี้จะเป็นบทความที่เกี่ยวข้องกับการเชื่อมต่อผ่านพอร์ทอนุกรม I2C  ( I2C-Bus )  ของบอร์ด  Arduino  เนื่องจากเวลาเขียนโปรเเกรมที่เกี่ยวข้องกับอุปกรณ์ I2C อาจจะเกิดการไม่ตอบสนองของอุปกรณ์ ทำให้ไม่สามารถรู้ได้ว่าเกิดปัญหาที่ตัวอุปกรณ์ การต่อสาย หรือ เขียนโปรเเกรมผิดพลาด ข้อดีของการเเสกน I2C Scanner ตรวจสอบว่าอุปกรณ์ I2C นั้นมี Address อะไร สามารถระบุได้ว่าอุปกรณ์ I2C นั้น ตอบสนองกับบอร์ดหรือไม่ *ถ้าอุปกรณ์ตอบสนองเเละเเสดง Adress ของอุปกรณ์ แสดงว่าอุปกรณ์นั้นผ่านการทดสอบเบื้องต้น สามารถนำไปเขียนโปรเเกรมใช้งานกับบอร์ด Arduino ได้ * ถ้าอุปกรณ์ไม่ตอบสนอง ลองเช็คสาย SDA หรือ SCL ว่าต่อสลับกันหรือไม่ ถ้าต่อถูกสายถูกเเล้ว เเละอุปกรณ์ไม่เเสดง Adress อุปกรณ์อาจมีปัญหา ตัวอย่างโปรเเกรมที่ใช้ ตัวอย่างวงจรที่ใช้ Real Time Clock (DS1307) และ 16x2 LCD  I2C  ผลลัพธ์ของการรันโปรเเกรม Referent     - https://playground.arduino.cc/Main/I2cScanner

Arduino - How to Install Library

Arduino - How to Install Library What is Library?           Library is a  collection of code  that makes it easy for  using modules or other devices. Arduino IDE are pre-install some libraries. If you want to install other libraries, you can download more from the Internet. How to Install Library. Install from Library Manager Install from Zip file Manual Installation Install from Library Manager           For installation of this library, you can open the Arduino IDE program. Select the Sketch > Include Library> Manage Library ...  Search Library > Select Version > Install Install from Zip file          For installation of this library, you can open the Arduino IDE program. Select the Sketch > Include Library> Add .Zip Library.  Then select the desired .zip file to add to the Arduino IDE. Manual installation          For installation, this library can be installed by opening the Document > Arduino > libraries and copying t

Arduino กับการติดตั้งไลบรารี่

Arduino กับการติดตั้งไลบรารี่ ไลบรารี่คืออะไร          ไลบรารี่คือชุดของโปรเเกรมสำหรับใช้งานโมดูลหรืออุปกรณ์อื่นๆ ที่อำนวยความสะดวกให้ผู้ใช้งานสามารถพัฒนาโปรเเกรมได้อย่างง่าย ภายในโปรเเกรม Arduino IDE จะติดตั้งไลบรารี่บางส่วนมาเเล้วหากต้องการติดตั้งไลบรารี่อื่นๆเพิ่มเติมสามารถดาวน์โหลดเพิ่มเติมได้จากอินเทอร์เน็ต การติดตั้งไลบรารี่ สามารถทำได้ 3 วิธีคือ ติดตั้งจาก Library Manager ติดตั้งจาก Zip file ติดตั้งเเบบ Manual ติดตั้งจาก Library Manager         สำหรับการติดตั้งไลบรารี่เเบบนี้สามารถเปิดโปรเเกรม Arduino IDE เลือกเเถบเครื่องมือ Sketch > Include Library > Manage Library... จากนั้นค้นหา เลือกเวอร์ชันของไลบรารี่ เเละติดตั้งได้ตามต้องการ ติดตั้งจาก Zip file          สำหรับการติดตั้งไลบรารี่เเบบนี้สามารถเปิดโปรเเกรม Arduino IDE เลือกเเถบเครื่องมือ Sketch > Include Library > Add .Zip Library จากนั้นเลือกไฟล์ไลบรารี่ .Zip ที่ต้องการเพิ่มลงไปในโปรเเกรม Arduino IDE ติดตั้งแบบ Manual          สำหรับการติดตั้งไลบรารี่เเบบนี้สามารถติดตั

Arduino Serial monitor

Arduino Serial monitor Serial Monitor is a component of the Arduino IDE. It can use - Show results from Arduino boards. - receive data from user and send data to the Arduino board. How to use? Setup baud rate void setup() {    Serial.begin(9600); } Show results in Serial Monitor Serial.print("Hello World");       /* Show Hello World */ Serial.println("Hello World");     /* Show Hello World And New Line */   Read data from Serial Monitor Serial.read(); How to open Serial Monitor 1. Ctrl + Shift + M 2. Click Icon Example - Show data to Serial Monitor Output the program Example - Read data from Serial Monitor - Sent 1 On LED -  Sent 0 Off LED Output  Read data from Serial Monitor * If Unsuccessful Check that selected:  No line ending And : 9600 baud?

Arduino กับการใช้งาน Serial Monitor

Arduino กับการใช้งาน Serial Monitor Serial Monitor คือ ส่วนหนึ่งของโปรแกรม Arduino IDE สามารถใช้งานได้ 2 อย่าง คือ - แสดงผลลัพธ์จากบอร์ด Arduino - ใช้รับข้อมูลจากผู้ใช้ แล้วส่งข้อมูลไปยังบอร์ด Arduino รูปแบบการใช้งาน Serial Monitor เริ่มต้นใช้งาน void setup() {    Serial.begin(9600); } แสดงผลออกทาง Serial Monitor Serial.print("Hello World");       /* แสดงคำว่า Hello World */ Serial.println("Hello World");     /* แสดงคำว่า Hello World และขึ้นบรรทัดใหม่ */   อ่านค่าจาก Serial Monitor Serial.read(); วิธีเปิด Serial Monitor 1. กด Ctrl + Shift + M 2. กด Icon ตัวอย่างการแสดงผลลัพธ์จากบอร์ด Arduino แสดงผลลัพธ์จากบอร์ด Arduino ตัวอย่างการรับค่าจาก Serial Monitor - ส่ง 1 เพื่อ On LED -  ส่ง 0 เพื่อ Off LED แสดงผลลัพธ์การรับค่าจาก Serial Monitor * ถ้าไม่สำเร็จ ตรวจสอบว่าเลือก No line ending และบอดเรทเป็น 9600 เเล้วหรือยัง

Arduino and Computer Connection

Arduino and Computer Connection This article will explain the connection between the Arduino board and computer. What can I do and how it works? Connection between Arduino board and computer What can do? - Upload firmware by Arduino IDE. - Receive/Send data between Arduino boards and computers. Principle of operation (Uno, Mega2560, Pro Micro, etc.)         Principles of connection between Arduino boards and computers. For example The firmware was uploaded to the Arduino board. The data from the computer was transferred to the USB To Serial converter, which converted the voltage from the computer to a TTL level and sent it to the MCU. Micro Controller Unit) via the Rx-Tx pin. The Arduino board has an updated firmware. The Arduino board and the computer are the same as uploading the firmware. Notice - Comport of Arduino Boards are Fixed. - If the Arduino board is attached to the computer, it will lose Hardware Serial. But in case of some boards such as L

การเชื่อมต่อระหว่างบอร์ด Arduino กับคอมพิวเตอร์

การเชื่อมต่อระหว่างบอร์ด Arduino กับคอมพิวเตอร์         สำหรับบทความในตอนนี้จะเป็นการอธิบายเบื้องต้นเกี่ยวกับการเชื่อมต่อระหว่างบอร์ด Arduino กับคอมพิวเตอร์ ว่าสามารถใช้ทำอะไรได้บ้างและมีการทำงานอย่างไร การเชื่อมต่อระหว่างบอร์ด Arduino กับคอมพิวเตอร์ เมื่อเชื่อมต่อกันเเล้วสามารถทำอะไรได้บ้าง - อัพโหลดเฟริมแวร์ที่พัฒนาขึ้นด้วยโปรเเกรม Arduino IDE - รับ/ส่งข้อมูลระหว่างบอร์ด Arduino และ คอมพิวเตอร์ หลักการทำงาน (Uno, Mega2560, Pro Micro, อื่นๆ)         หลักการทำงานของการเชื่อมต่อระหว่างบอร์ด Arduino กับคอมพิวเตอร์ ยกตัวอย่างเช่น การอัพโหลดเฟิร์มแวร์ที่พัฒนาเสร็จเเล้วลงบนบอร์ด Arduino ข้อมูลจากฝั่งคอมพิวเตอร์จะถูกไอซี USB To Serial แปลงระดับเเรงดันจากคอมพิวเตอร์ให้เป็นระดับเเรงดัน TTL เเล้วส่งไปยัง  MCU (Micro Controller Unit) ผ่านทางขา Rx-Tx ทำให้บอร์ด Arduino มีเฟริมแวร์ตัวที่เพิ่งอัพเดทเข้ามา ส่วนการรับ/ส่งข้อมูลระหว่างบอร์ด Arduino และคอมพิวเตอร์ก็ลักษณะเดียวกับการอัพโหลดเฟริมแวร์ ข้อสังเกตุ - Comport ของบอร์ด Arduino คงที่ - ในกรณีที่ต่อบอร์ด A