need of code for 10 digit text editing using 89c51

Status
Not open for further replies.

prakashvenugopal

Advanced Member level 1
Joined
Jun 1, 2011
Messages
473
Helped
15
Reputation
30
Reaction score
15
Trophy points
1,298
Activity points
4,973
Hi all,

I am working in atmel 89c51. I need to edit parameter and store the data in EEPROM. Right now, i had edited the
10 digit editing using LCD. The 10 digit which i edited is numbers (i.e)( 0 to 9). Now i have to edit the text parameters also I.e. (0 to 9 ) and after 9, it should be (A to Z). How to do this text editing?. did anyone having this text editing code.
Please help.

Note:
I am having 4 keys in my board.
Menu key --> to move from one menu to another menu
up key --> to increment the number digits 0 to 9 and A to Z
down key --> to decrement the number digits Z to A and 9 to 0
enter key --> to save the settings.

Thanks in advance,
V. Prakash
 

Is this what you need?



Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
....
....
switch (keypress)
{ 
  case  0:  //up 
  {
      if (last_value==0x39)//if last value is '9' then set as 'A'
      {
          last_value=0x41;
      }
      else
      if (last_value==0x5A)//if last value is 'Z' then set as '0' (zero)
      {
          last_value=0x30;
      }
      else last_value++;   //else, do normal increment
      break;
  };
  case  1:  //down
  {
      if (last_value==0x41)//if last value is 'A' then set as '9'
      {
          last_value=0x39;
      }
      else
      if (last_value==0x30)  //if last value is '0' (zero) then set as 'Z'
      {
          last_value=0x5A;
      }
      else last_value--; //else, do normal decrement
      break;
  };
.... 
....
.... 
};

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