Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********* Pleasedontcode.com **********
- Pleasedontcode thanks you for automatic code generation! Enjoy your code!
- - Terms and Conditions:
- You have a non-exclusive, revocable, worldwide, royalty-free license
- for personal and commercial use. Attribution is optional; modifications
- are allowed, but you're responsible for code maintenance. We're not
- liable for any loss or damage. For full terms,
- please visit pleasedontcode.com/termsandconditions.
- - Project: LCD Control
- - Source Code compiled for: Arduino Nano
- - Source Code created on: 2023-12-25 08:58:25
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* Print "Merry Christmas!" In loop function */
- /****** END SYSTEM REQUIREMENTS *****/
- /****** DEFINITION OF LIBRARIES *****/
- #include <Arduino.h>
- #include <Wire.h>
- #include <LiquidCrystal_I2C.h>
- /****** FUNCTION PROTOTYPES *****/
- void setup(void);
- void loop(void);
- /***** DEFINITION OF I2C PINS *****/
- const uint8_t Lcd_LCD1602I2C_I2C_PIN_SDA_A4 = A4;
- const uint8_t Lcd_LCD1602I2C_I2C_PIN_SCL_A5 = A5;
- const uint8_t Lcd_LCD1602I2C_I2C_SLAVE_ADDRESS = 0x27;
- /****** DEFINITION OF LIBRARY CLASS INSTANCES*****/
- LiquidCrystal_I2C lcd(Lcd_LCD1602I2C_I2C_SLAVE_ADDRESS, 20, 4);
- void setup(void)
- {
- // Initialize the I2C communication
- Wire.begin();
- // Initialize the LCD
- lcd.begin(20, 4);
- // Turn on the backlight
- lcd.backlight();
- // Set the cursor position and print the text
- lcd.setCursor(3, 0);
- lcd.print("Hello, world!");
- lcd.setCursor(2, 1);
- lcd.print("Ywrobot Arduino!");
- lcd.setCursor(0, 2);
- lcd.print("Arduino LCM IIC 2004");
- lcd.setCursor(2, 3);
- lcd.print("Power By Ec-yuan!");
- }
- void loop(void)
- {
- // Print "Merry Christmas!" repeatedly
- lcd.setCursor(0, 3);
- lcd.print("Merry Christmas!");
- // Delay for 1 second
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement