Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Wire.h>
- #include <LiquidCrystal_I2C.h>
- int pot = 3;
- 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.
- //conexion de i2c
- //sda: A4
- //scl: A5
- //Funciona en el loop sin scroll descontrlado
- void setup(){
- Serial.begin(9600);
- lcd.begin(16,2); // iInit the LCD for 16 chars 2 lines
- lcd.backlight(); // Turn on the backligt (try lcd.noBaklight() to turn it off)
- lcd.setCursor(0,0); //First line
- //lcd.print("Petro");
- lcd.setCursor(0,1); //Second line
- //lcd.print("Presidente");
- }
- void loop(){
- int potenciometro = analogRead(pot);
- lcd.clear();
- lcd.setCursor(0,0);
- lcd.print("Valor Potenciometro");
- lcd.setCursor(0,1);
- lcd.print(potenciometro);
- delay(75);
- }
Advertisement
Add Comment
Please, Sign In to add comment