Tuesday, July 5, 2022

A Simple Two-Wire LCD Programming With Arduino Uno

In this example, I use PCF8574T module that designed for character LCD interfacing. We can solder this module directly with the LCD. However I put either PCF8574T module and the LCD on a single breadboard.

A Simple Two-Wire LCD Programming With Arduino Uno

Running program

 The connection between the Arduino Uno and the two-wire display module uses only two communication wires, and two power supply pins.

  1. GND
  2. +5V (VDD)
  3. SCL connects to Arduino pin A5
  4. SDA connects to Arduino pin A4

It need the LiquidCrystal_I2C.h file that we need to install it. The program will show a simple text display with a little delay between each characters.

  1. //Two-Wire Library
  2. #include <Wire.h>
  3. #include <LiquidCrystal_I2C.h>
  4.  
  5. //LCD Setting
  6. LiquidCrystal_I2C lcd(0x27,16,2);
  7.  
  8. void setup(){
  9. //Initialize the LCD
  10. lcd.init();
  11. //Turn on the back light
  12. lcd.backlight();
  13. //Blink the cursor
  14. lcd.blink();
  15.  
  16. lcdShow("AKI Technical");
  17. lcd.setCursor(0,1);
  18. lcdShow("YouTube Channel");
  19. }
  20.  
  21. void lcdShow(char *txt){
  22. while(*txt){
  23. lcd.print(*txt++);
  24. delay(500);
  25. }
  26. }
  27.  
  28. void loop(){
  29.  
  30. }
  31.  

 Click here to download its source file.

We can use the ATMega32 to control a 3-Wire SPI LCD module (SN74HC595N chip).

No comments:

Post a Comment

Search This Blog

Labels

25AA010A (1) 8051 (7) 93AA46B (1) ADC (30) Analog Comparator (1) Arduino (15) ARM (6) AT89C52 (7) ATMega32 (54) AVR (57) CCS PICC (28) DAC (1) DHT11 (2) Display (105) Distance Sensor (3) DS18B20 (3) dsPIC (2) dsPIC30F1010 (2) EEPROM (5) Environment Sensor (4) esp8266 (1) I2C (29) Input/Output (67) Interrupt (19) Keil (5) Keypad (10) LCD (46) Master/Slave (1) MAX7221 (1) MCP23017 (5) MCP23S17 (4) Meter (3) MikroC (2) Motor (15) MPLABX (66) Nokia 5110 LCD (3) OLED (2) One-Wire (6) Oscillator (8) PCB (6) PCD8544 (3) PCF8574 (5) PIC (107) PIC12F (2) PIC16F628A (2) PIC16F630 (1) PIC16F716 (3) PIC16F818 (10) PIC16F818/819 (2) PIC16F84A (15) PIC16F876A (1) PIC16F877A (9) PIC16F88 (1) PIC16F887 (60) PIC18 (19) PIC18F1220 (4) PIC18F2550 (3) PIC18F4550 (12) PWM (11) RTC (8) Sensor (10) SH1106 (1) Shift Register (11) Shift Registers (2) SPI (24) STM32 (6) STM32 Blue Pill (6) STM32CubeIDE (6) STM32F103C8T6 (6) SysTick (3) temperature sensor (11) Thermometer (21) Timer/Counter (30) TM1637 (2) UART (7) Ultrasonic (4) Voltmeter (7) WDT (1) XC16 (2) XC8 (94)