ad
Joined: 24 Mar 2015 Posts: 14
|
Keyboard Menu |
Posted: Fri Apr 17, 2015 2:01 am |
|
|
I want a menu that touching a keyboard key data is obtained. It would be as follows:
Select: 1. Obtain 2. Transmit
If you select one, another menu with 4 options ( 1.Temp 2.NCOMB 3.RPM 4.VEL ) appears.
If you select two would have to appear on screen transmitting data.
In the submenu of the parameters would also have to have an option to turn back.
Here I leave the code I've tried to do.
Code: |
void main(){
//Variable de las funciones de parametros
char k;
int x;
lcd_init();
kbd_init();
port_b_pullups(TRUE);
//Mensaje de Inicio
lcd_gotoxy(4,1);
printf(lcd_putc, "BIENVENIDOS");
lcd_gotoxy(7,2);
printf(lcd_putc, "FLIPS");
delay_ms(300);
lcd_putc('\f');
lcd_gotoxy(4,1);
printf(lcd_putc, "MARTES 10");
lcd_gotoxy(4,2);
printf(lcd_putc, "MAYO 2015");
delay_ms(300);
lcd_putc('\f');
lcd_gotoxy(1,1);
printf(lcd_putc, "REALIZADO POR:");
lcd_gotoxy(1,2);
printf(lcd_putc, "xxx");
delay_ms(300);
lcd_putc('\f');
lcd_gotoxy(1,1);
printf(lcd_putc, "SELECCIONE:");
lcd_gotoxy(1,2);
printf(lcd_putc,"1.OBT 2.TRANS");
while(1){ //Bucle infinito siempre consulta el teclado
k=kbd_getc(); //leer el teclado
x=k-48; //Conversion numerica
switch(k){
case 1:
lcd_gotoxy(1,1);
printf(lcd_putc, "1.TEMP 2.NCOMB");
lcd_gotoxy(1,2);
printf(lcd_putc, "3.RPM 4.VEL");
delay_ms(300);
lcd_putc('\f');
switch (k){
case 1:
lcd_gotoxy(1,1);
printf(lcd_putc,"OBT.DATOS...");
NTC();
break;
case 2:
lcd_gotoxy(1,1);
printf(lcd_putc,"OBT.DATOS...");
NIVEL_COMBUSTIBLE();
break;
case 3:
lcd_gotoxy(1,1);
printf(lcd_putc,"OBT.DATOS...");
REVOLUCIONES();
break;
case 4:
lcd_gotoxy(1,1);
printf(lcd_putc,"OBT.DATOS...");
VELOCIDAD();
break;
case 5:
lcd_gotoxy(1,1);
printf(lcd_putc,"MENU PRINCIPAL");
break;
}
case 2:
lcd_gotoxy(1,1);
printf(lcd_putc,"TRANS.DATOS...");
}
}
}
|
|
|