Advertisement
gusto2

Arduino LCM 1602 Anduino / Uno

May 24th, 2016
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. Pinout:
  2.  
  3. GND => GND
  4. VCC => 5V
  5. SDA => A4
  6. SCL => A5
  7.  
  8. #include <Wire.h>
  9. #include <LiquidCrystal_I2C.h>
  10.  
  11.  
  12.  
  13. #define BACKLIGHT_PIN 13
  14.  
  15. // LiquidCrystal_I2C lcd(0x27); // Set the LCD I2C address
  16.  
  17. LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
  18.  
  19.  
  20. void setup()
  21. {
  22. // Switch on the backlight
  23. pinMode ( BACKLIGHT_PIN, OUTPUT );
  24. digitalWrite ( BACKLIGHT_PIN, HIGH );
  25. lcd.init();
  26.  
  27. lcd.begin(16,2);
  28.  
  29. lcd.clear();
  30. lcd.backlight();
  31. lcd.setCursor(0,0); //Start at character 0 on line 0
  32. lcd.print("Welcome ");
  33. lcd.setCursor(0,1);
  34. lcd.print("to the I2C LCD");
  35. // lcd.noBacklight();
  36.  
  37. }
  38.  
  39. void loop()
  40. {
  41. delay (200);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement