Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.66 KB | None | 0 0
  1. #include <Wire.h>  
  2. #include <LiquidCrystal_I2C.h>
  3. int pot = 3;  
  4. LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Si no muestra nada la pantalla
  5. //reemplazar 0x27 por 0x3F
  6. //sda: A4
  7. //scl: A5
  8.  
  9. //Funciona en el loop sin scroll descontrlado
  10. void setup(){
  11.   Serial.begin(9600);
  12.   lcd.begin(16,2);   //
  13.   lcd.backlight();   // Enciende la luz de la pantalla
  14.   lcd.setCursor(0,0); //Linea Superior
  15.  
  16.   lcd.setCursor(0,1); //Linea Inferior
  17.  
  18. }
  19.  
  20. void loop(){
  21.   int potenciometro = analogRead(pot);
  22.   lcd.clear();
  23.   lcd.setCursor(0,0);
  24.   lcd.print("Valor Potenciometro");
  25.   lcd.setCursor(0,1);
  26.   lcd.print(potenciometro);
  27.   delay(75);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement