CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Keyboard Menu

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ad



Joined: 24 Mar 2015
Posts: 14

View user's profile Send private message

Keyboard Menu
PostPosted: Fri Apr 17, 2015 2:01 am     Reply with quote

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...");
      }
      }
}
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group