Skip to main content

Posts

Showing posts from November, 2018

Arduino กับการใช้งานจอ LCD (Liquid Crystal Display) แบบ I2C

Arduino กับการใช้งานจอ LCD (Liquid Crystal Display) แบบ I2C         ในบทความนี้จะเป็นบทความการใช้งานบอร์ด Arduino กับจอ Liquid Crystal ขนาด 16x2 แบบ I2C ลักษณะการใช้งานคล้ายๆ บทความ  Arduino กับการใช้งานจอ LCD (Liquid Crystal Display)  คือ ให้บอร์ด Arduino ส่งข้อมูลต่างๆ เช่น ข้อความ หรือ ค่าเอาต์พุตจากเซ็นเซอร์ เพื่อเเสดงผลยังหน้าจอ LCD เเต่จะมีชุดควบคุม(PCF8574) สำหรับควบคุมการทำงานของจออีกทีหนึ่ง จึงทำให้ลดจำนวนขาการใช้งาน เหลือเพียง 4 เส้น รายละเอียดต่างๆ ของชุดควบคุมจอจะมีดังนี้ ขาสัญญาณสำหรับต่อเข้ากับบอร์ด Arduino ตัวต้านทานแบบปรับค่าได้สำหรับปรับ Contrast ของตัวอักษร ตัวเลือก Address ของจอ จั๊มเปอร์เเบล็คไลท์ การเชื่อมต่อระหว่างจอ LCD และบอร์ด Arduino ติดตั้งไลบรารี่ ไปที่ Library Manager ค้นหา "LiquidCrystal i2c" เเล้วติดตั้ง ( ดูการติดตั้งไลบรารี่เพิ่มเติม ) ค้นหา I2C Adress ของชุดควบคุมจอ เพื่อตรวจสอบการเชื่อมต่อ เเละ ค้นหา Address ของชุดควบคุมจอ ( ดูการแสกน I2C Adress เพิ่มเติม ) หลังจากได้ Address เเล้ว นำ Address ที่ได้ไปใส่ในตัว

Arduino - How to use Liquid Crystal Display I2C

Arduino - How to use Liquid Crystal Display I2C In this article will be How to use Arduino board with Liquid Crystal I2C, It same  Arduino Lcd Liquid Crystal Display    Examples applications, Arduino boards send text or output from sensor to show on LCD screen.  But there is another control unit (PCF8574) to control the screen. This reduces the number of pins to 4 lines. Details of PCF8574 (LCD  Controller ) Signal pin (i2c) from Arduino Board Potentiometer for adjust Contrast of character Address Selector pad Black light jumper  Circuit Install Library go to Library Manager -> Search  "LiquidCrystal i2c" -> Install  ( See more ) Scan I2C Adress  of  PCF8574  (LCD  Controller ) Check connection and Search Address  of  PCF8574  (LCD  Controller )  ( See more ) After find the PCF8574 Address, Take this in Example Code (0x27 or 0x3F) Example Code output program * If LCD not show characters try adjust the potentiometer   Refer

Arduino - LCD (Liquid Crystal Display)

Arduino - LCD (Liquid Crystal Display) This article will give you an example of how to use Arduino board with 16x2 Liquid Crystal LCD (16 characters in 2 lines). Examples applications, Arduino boards send text or output from sensor to show on LCD screen. LCD pin LCD RS pin       to digital pin 12 LCD Enable pin to digital pin 11 LCD D4 pin       to digital pin 5 LCD D5 pin       to digital pin 4 LCD D6 pin       to digital pin 3 LCD D7 pin       to digital pin 2 LCD Vo pin       to Output from potentiometer 10k Ohm for adjust the contrast of the character. LCD Anode       to resistor 220 Ohm for power the backlight of the display LCD Cathode    to GND Example Program #include <LiquidCrystal.h> const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); void setup() {   // set up the LCD's number of columns and rows:   lcd.begin(16, 2);   // Print a message to the LCD.   lcd.print("hello, world!&q

Arduino กับการใช้งานจอ LCD (Liquid Crystal Display)

Arduino กับการใช้งานจอ LCD (Liquid Crystal Display)         ในบทความนี้จะเป็นตัวอย่างการใช้งานบอร์ด Arduino กับจอ LCD แบบ Liquid Crystal ขนาด 16x2 ( 16 ตัวอักษร 2 บรรทัด) โดยให้บอร์ด Arduino ส่งข้อมูลต่างๆ เช่น ข้อความ หรือ ค่าเอาต์พุตจากเซ็นเซอร์ เพื่อเเสดงผลยังหน้าจอ LCD ขาต่างๆของจอ การเชื่อมต่อระหว่างจอ LCD และบอร์ด Arduino LCD RS pin       to digital pin 12 LCD Enable pin to digital pin 11 LCD D4 pin       to digital pin 5 LCD D5 pin       to digital pin 4 LCD D6 pin       to digital pin 3 LCD D7 pin       to digital pin 2 LCD Vo pin       to เอาต์พุตจากตัวต้านทานปรับค่าได้ขนาด 10k โอห์ม เพื่อใช้ในการปรับความคมชัดของตัวอักษร  LCD Anode       to ตัวต้านทาน 220 โอห์ม เพื่อใช้ในการเปิดปิดเเบล็คไลท์ของจอ LCD Cathode    to GND ตัวอย่างโปรเเกรมที่ใช้ #include <LiquidCrystal.h> const  int  rs  =   12 ,  en  =   11 ,  d4  =   5 ,  d5  =   4 ,  d6  =   3 ,  d7  =   2 ; LiquidCrystal lcd ( rs ,  en ,  d4 ,  d5 ,  d6 ,  d7 ) ; void   setup ( )   {    //