JecarDatha Electronics MICROCONTROLADOR 16F877A | Page 38

56:if(f2==1 && c3==1 )

57:{

58:lcd_gotoxy(1,1);

59:lcd_putc("TECLA PULSADA: \n"); 60:lcd_putc(f);

61:}

62:if(f3==1 && c1==1 )

63:{

64:lcd_gotoxy(1,1);

65:lcd_putc("TECLA PULSADA: \n"); 66:lcd_putc(g);

67:}

68:if(f3==1 && c2==1 )

69:{

70:lcd_gotoxy(1,1);

71:lcd_putc("TECLA PULSADA: \n"); 72:lcd_putc(h);

73:}

74:if(f3==1 && c3==1 )

75:{

76:lcd_gotoxy(1,1);

77:lcd_putc("TECLA PULSADA: \n"); 78:lcd_putc(i);

79:}

80:if(f4==1 && c1==1 )

81:{

82:lcd_gotoxy(1,1);

83:lcd_putc("TECLA PULSADA: \n"); 84:lcd_putc(j);

85:}

86:if(f4==1 && c2==1 )

87:{

88:lcd_gotoxy(1,1);

89:lcd_putc("TECLA PULSADA: \n"); 90:lcd_putc(k);

91:}

92:if(f4==1 && c3==1 )

93:{

94:lcd_gotoxy(1,1);

95:lcd_putc("TECLA PULSADA: \n"); 96:lcd_putc(l);

97:}

98:}

99: }

100: ///////////////////////////////////////// 101: void main()//Abrimos la funcion principal 102: {

103:lcd_init();//Inicializamos la LCD

104:

105:while(true)//Iniciamos el bucle

106:{

107: f1=input(pin_b0);//Guardamos en f1 el valor ingresado en el pin b0

108: f2=input(pin_b1);//Guardamos en f2 el valor ingresado en el pin b1

109: f3=input(pin_b2);//Guardamos en f3 el valor ingresado en el pin b2

110: f4=input(pin_b3);//Guardamos en f4 el valor ingresado en el pin b3

111: c1=input(pin_b4);//Guardamos en c1 el valor ingresado en el pin b4

35