Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <LiquidCrystal.h>; // se incluye la liberia para el LCD
- int foto=0;
- int leer;
- //se inicializa la libreria con el numero de pins
- LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
- //se define la variable text de tipo String
- byte Modo1[8] = {31,31,31,0,0,0,0,0};
- byte Modo2[8] = {0,0,0,0,0,31,31,31};
- byte Modo3[8] = {31,31,31,0,0,0,31,31};
- byte Modo4[8] = {28,30,31,31,31,31,30,28};
- byte Modo5[8] = {7,15,31,31,31,31,15,7};
- byte Modo6[8] = {31,31,31,31,31,31,31,31};
- byte Modo7[8] = {0,0,0,0,0,0,0,0};
- void setup()
- {
- lcd.createChar(1, Modo1);
- lcd.createChar(2, Modo2);
- lcd.createChar(3, Modo3);
- lcd.createChar(4, Modo4);
- lcd.createChar(5, Modo5);
- lcd.createChar(6, Modo6);
- lcd.createChar(7, Modo7);
- lcd.begin(16, 2);
- Serial.begin(9600);
- }
- void loop()
- {
- int Numeros [10][6] =
- {
- {
- 6,1,6,6,2,6 }
- ,
- {
- 1,6,7,2,6,2 }
- ,
- {
- 1,3,4,5,2,2 }
- ,
- {
- 1,3,4,2,2,4 }
- ,
- {
- 6,2,6,7,7,6 }
- ,
- {
- 6,3,1,2,2,4 }
- ,
- {
- 6,3,1,6,2,4 }
- ,
- {
- 1,1,4,7,6,7 }
- ,
- {
- 5,3,4,5,2,4 }
- ,
- {
- 5,3,6,7,7,6 }
- ,
- };
- leer = analogRead(foto);
- int u=leer%10;
- int u1=((leer-u)%100)/10;
- int u2=(leer-(u1*10)-u)/100;
- int Valor [3] = {u2,u1,u};
- for (int p=0;p<=2;p++){
- for (int j=0;j<=1;j++){
- for (int k=0;k<=2;k++){
- lcd.setCursor(k+(p*4),j);
- if (j==0) {
- lcd.write(Numeros [Valor[p]][k]);
- lcd.setCursor(13,j);
- lcd.println("Ohm");
- }
- else if (j==1){
- lcd.write(Numeros [Valor[p]][k+3]);
- }
- }
- }
- }
- delay (1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement