| ??? 09/10/10 17:39 Read: times |
#178511 - variable name dilema Responding to: ???'s previous message |
>> I have used the variable "state_var" in many of the functions as well as the main program
an alternative is that i could use "program_state" as it represents various states of the program at different stages and not just the inputs(i have used it for input also) >> I have written this for loop to break or skip the next display as shown
for(i=0; i<1; i++)
{
lcd_disp1(lcd_door,0); //prompt the user to press a button to open or close a door
temp=input_keypad(); //wait and see if the user gives input
if(temp != ERROR_VAL)break;// if input is given skip the next 2 display statements
// and go to the if statement present after this for loop
lcd_disp1(lcd_change,0); //prompt the user to press a button to change password
temp=input_keypad(); //wait and see if the user gives input
if(temp != ERROR_VAL)break;// if input is given skip the next display statements
// and go to the if statement present after this for loop
lcd_disp1(lcd_exit,0);
temp=input_keypad();
//if(temp != ERROR_VAL)break; as you pointed out this is my mistake
}
if(temp==KEY_DOOR_OPENCLOSE)
{
if(door_state==1)
{........
>> lcd_disp( QUESTION_MARK_CHARACTER ); this is not an input prompt its more like the ****** that appears when we type password in computers >>(global declaration) unsigned char present_key[]="12345600" in the change_key() function i have used the following code
for(i=0; i<8; i++)
{
present_key[i] = password[i];
}
will the variable, present_key hold "12345600" or the new value assigned to it after reset(i want it to hold the new value not "12345600") |
| Topic | Author | Date |
| Please assess the c code written by me | 01/01/70 00:00 | |
| Lots of details to improve on | 01/01/70 00:00 | |
| REALLY confusing | 01/01/70 00:00 | |
| timer delay review | 01/01/70 00:00 | |
| what about this timer program | 01/01/70 00:00 | |
| Still a lot of work to do | 01/01/70 00:00 | |
| I have implemented many of the suggestions | 01/01/70 00:00 | |
| Still not thinking about your symbol names | 01/01/70 00:00 | |
variable name dilema | 01/01/70 00:00 |



