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 support@ccsinfo.com

LCD Menu With 2 Buttons

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



Joined: 19 Feb 2009
Posts: 3

View user's profile Send private message Send e-mail MSN Messenger

LCD Menu With 2 Buttons
PostPosted: Fri Feb 20, 2009 11:29 am     Reply with quote

This might sound odd but...

Basically i have tried if statements and while statements none to which work.

I have 3 variables v1, v2, v3

I have 2 buttons right and left

Originally i want v1 to be sent to lcd this is no problem.

I then want with right button pressed to then show v2
when v2 is shown left will show v1 and right will show v3

Ive tried using another variable as a flag to let me no what the original state is but this doesn't help.

In my while or if loops i do have a warning saying assingment inside relational expression, im thinking this is to due with the flag beeing in the if statement when the if statement is determined from the flag maybe ?

here is come code i have tried.....

Code:


DATA(0XC0);                  // DISPLAY 1st COLUM 2nd ROW
            OUTPUT_A(1);               //Turn r/s on
            character_in(q1a1);
            OUTPUT_A(0);               // Turn r/s LOW
            q1sel=1;      //q1sel is the flag
   

            while (!input (GP4))    // check enter button ignor this
            {   
               
            while(input (GP3))  // check left button
            {
               while(q1sel=1)
               {
                     DATA(0XC0);                  // DISPLAY 1st COLUM 2nd ROW
                     OUTPUT_A(1);               //Turn r/s on
                     character_in(q1a1);
                     OUTPUT_A(0);               // Turn r/s LOW
               }

               while(q1sel=2)
               {
                     DATA(0XC0);                  // DISPLAY 1st COLUM 2nd ROW
                     OUTPUT_A(1);               //Turn r/s on
                     character_in(q1a2);
                     OUTPUT_A(0);               // Turn r/s LOW
               }
               while(q1sel=3)
               {
                     DATA(0XC0);                  // DISPLAY 1st COLUM 2nd ROW
                     OUTPUT_A(1);               //Turn r/s on
                     character_in(q1a3);
                     OUTPUT_A(0);               // Turn r/s LOW
               }
               
               q1sel++;
                  
            }      
            }            
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