Advertisement
pleasedontcode

LCD Text rev_01

May 9th, 2024
724
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /********* Pleasedontcode.com **********
  2.  
  3.     Pleasedontcode thanks you for automatic code generation! Enjoy your code!
  4.  
  5.     - Terms and Conditions:
  6.     You have a non-exclusive, revocable, worldwide, royalty-free license
  7.     for personal and commercial use. Attribution is optional; modifications
  8.     are allowed, but you're responsible for code maintenance. We're not
  9.     liable for any loss or damage. For full terms,
  10.     please visit pleasedontcode.com/termsandconditions.
  11.  
  12.     - Project: LCD Text
  13.     - Source Code NOT compiled for: Arduino Uno
  14.     - Source Code created on: 2024-05-09 17:44:05
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* This code will breathalyzer with a library liquid */
  21.     /* cristal_I2c with  address 0x27 and measurements of */
  22.     /* 12x2 ; and make calculate the level of alcohol in */
  23.     /* grams; with connections from MQ3 to Arduino= VCC */
  24.     /* to 5V, 6ND to 6ND, A6 to A0; Arduino to LCD =6ND t */
  25. /****** END SYSTEM REQUIREMENTS *****/
  26.  
  27. /****** DEFINITION OF LIBRARIES *****/
  28. #include <Wire.h>
  29. #include <LiquidCrystal_I2C.h>  //https://github.com/marcoschwartz/LiquidCrystal_I2C
  30.  
  31. /****** FUNCTION PROTOTYPES *****/
  32. void setup(void);
  33. void loop(void);
  34.  
  35. /***** DEFINITION OF I2C PINS *****/
  36. const uint8_t display_LCD1602I2C_I2C_PIN_SDA_A4     = A4;
  37. const uint8_t display_LCD1602I2C_I2C_PIN_SCL_A5     = A5;
  38. const uint8_t display_LCD1602I2C_I2C_SLAVE_ADDRESS      = 0x27;
  39.  
  40. /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
  41. LiquidCrystal_I2C lcd(0x27, 12, 2);  // set the LCD address to 0x27 for a 12 chars and 2 line display
  42.  
  43. void setup(void)
  44. {
  45.     // put your setup code here, to run once:
  46.     lcd.init();                      // initialize the lcd
  47.     lcd.backlight();
  48.     lcd.setCursor(3, 0);
  49.     lcd.print("Hello, world!");
  50.     lcd.setCursor(2, 1);
  51.     lcd.print("Ywrobot Arduino!");
  52.     lcd.setCursor(0, 2);
  53.     lcd.print("Arduino LCM IIC 2004");
  54.     lcd.setCursor(2, 3);
  55.     lcd.print("Power By Ec-yuan!");
  56. }
  57.  
  58. void loop(void)
  59. {
  60.     // put your main code here, to run repeatedly:
  61. }
  62.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement