safwan092

LCD Test

Mar 1st, 2020
125
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <LiquidCrystal.h>
  2.  
  3. /*
  4.    LCD in 4-Bit-Modus:
  5.        LCD RS pin an digital pin 8
  6.        LCD RW pin an digital pin 13
  7.        LCD Enable pin an digital pin 9
  8.        LCD D4 pin an digital pin 4
  9.        LCD D5 pin an digital pin 5
  10.        LCD D6 pin an digital pin 6
  11.        LCD D7 pin an digital pin 7
  12. */
  13.  
  14. // Setup LCD-Shield
  15. LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7);
  16.  
  17. void setup() {
  18.   // Display initialisieren
  19.   lcd.clear();
  20.   lcd.begin(16, 2); // 16x2 Zeichen
  21.   lcd.setCursor(0, 0);
  22.   lcd.print("LightMeter v1.0");
  23.   lcd.setCursor(0, 1);
  24.   lcd.print("Initializing...");
  25.   delay(1000);
  26.   lcd.clear();
  27.  
  28. }
  29.  
  30. void loop() {
  31.   lcd.setCursor(0, 0);
  32.   lcd.print("Light level: ");
  33.   lcd.setCursor(5, 1);
  34.   lcd.print(15);
  35.   lcd.print(" lx");
  36.   delay(500);
  37. }
RAW Paste Data