Help On Menu using switch

Status
Not open for further replies.

cnandha19

Member level 3
Joined
Aug 28, 2015
Messages
59
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
604
I want to go to sub menu is it correct way

1.Enter key pressed means it prints
1.ADMIN
2.Operator
3.Setter
In sub menu if '1' pressed it has to go to 1st menu (ADMIN) please help regarding this
if '2' pressed it has to go to 2nd menu (Setter)

Code:
        key  =READ_SWITCHES();
        switch(menu)
		{
			
			case mIdle:
			{
				
						
				switch (key)
				{
				 unsigned char ret ; 
				 case enterkeystore:
				 {
					 lcdClear();
					 lcdMoveCursor(0,0);
					 lcdPrintStr("1.ADMIN");
					 lcdMoveCursor(1,0);
					 lcdPrintStr("2.SETTER");
					 lcdMoveCursor(2,0);
					 lcdPrintStr("3.OPERATOR");
					 delay_s(1);
					 ret =READ_SWITCHES();
					 
					 if(ret == '1')
					 {
						 lcdClear();
						 lcdMoveCursor(1,0);
						 lcdPrintStr("ADMIN");
						 delay_s(1);
					 }

                                         if(ret == '2')
					 {
						 lcdClear();
						 lcdMoveCursor(1,0);
						 lcdPrintStr("SETTER");
						 delay_s(1);
					 }
					
				 }
				 break;
 

your code MAKES NO SENSE AT ALL.
Why are there so many variables ... Key, MiDle, enterkeystroke, ret ??

With Switch/ case/switch case all nested one inside the other ?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…