document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  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);  // Set the LCD I2C address, if it\'s not working try 0x27.
  5. //conexion de i2c
  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);   // iInit the LCD for 16 chars 2 lines
  13.   lcd.backlight();   // Turn on the backligt (try lcd.noBaklight() to turn it off)
  14.   lcd.setCursor(0,0); //First line
  15.   //lcd.print("Petro");
  16.   lcd.setCursor(0,1); //Second line
  17.   //lcd.print("Presidente");
  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. }
');