Professional Documents
Culture Documents
UNIDAD 2
GRUPO: 309696_5
PRESENTADO A:
PRESENTADO POR:
CODIGO: 1.047.376.709
INGENIERIA ELECTRONICA
2017
2. El cual deberá en un display 16X2 desplegar el nombre del curso, numero
de grupo y los nombres uno por uno de los integrantes del grupo
Seguido del número de cedula los cuales cambiaran al presionar cada
uno de los 5 pulsadores (1 al 5 igual número de integrantes)
void integrante1()
{Lcd_Out(1,1,"1 CC 1047376709");
Lcd_Out(2,1,int1);
delay_ms (1000);
}
void integrante2()
{Lcd_Out(1,1,"2 CC 1096198623");
Lcd_Out(2,1,int2);
delay_ms (1000);
}
void integrante3()
{Lcd_Out(1,1,"3 CC 1048849124");
Lcd_Out(2,1,int3);
delay_ms (1000);
}
void integrante4()
{Lcd_Out(1,1,"4");
Lcd_Out(2,1,int3);
delay_ms (1000);
}
void integrante5()
{Lcd_Out(1,1,"5");
Lcd_Out(2,1,int3);
delay_ms (1000);
}
void main(){
ANSEL = 0;
ANSELH = 0;
C1ON_bit = 0;
C2ON_bit = 0;
Lcd_Init();
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Out(1,1,txt1);
Lcd_Out(2,1,txt2);
delay_ms (1000);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1,1,txt3);
Lcd_Out(2,1,txt4);
delay_ms (1000);
Lcd_Cmd(_LCD_CLEAR);
integrante1();
Lcd_Cmd(_LCD_CLEAR);
integrante2();
Lcd_Cmd(_LCD_CLEAR);
integrante3();
Lcd_Cmd(_LCD_CLEAR);
integrante4();
Lcd_Cmd(_LCD_CLEAR);
integrante5();
Lcd_Cmd(_LCD_CLEAR);
while(1) {
if (Button(&PORTD, 0, 1, 0)) { //Integrante 1
puls1 = 1;
}
if (puls1 && Button(&PORTD, 0, 1, 1)) {
Lcd_Cmd(_LCD_CLEAR);
integrante1();
puls1 = 0;
}
if (Button(&PORTD, 1, 1, 0)) {
puls2 = 1;
}
if (puls2 && Button(&PORTD, 1, 1, 1)) { //Integrante 2
Lcd_Cmd(_LCD_CLEAR);
integrante2();
puls2 = 0;
}
if (Button(&PORTD, 2, 1, 0)) { //Integrante 3
puls3 = 1;
}
if (puls3 && Button(&PORTD, 2, 1, 1)) {
Lcd_Cmd(_LCD_CLEAR);
integrante3();
puls3 = 0;
}
if (Button(&PORTD, 3, 1, 0)) { //Integrante 4
puls4 = 1;}
if (puls4 && Button(&PORTD, 3, 1, 1)) {
Lcd_Cmd(_LCD_CLEAR);
integrante4();
puls4 = 0;
}
if (Button(&PORTD, 4, 1, 0)) { //Integrante 5
puls5 = 1;
}
if (puls5 && Button(&PORTD, 4, 1, 1)) {
Lcd_Cmd(_LCD_CLEAR);
integrante5();
puls5 = 0;
}
}
}