Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Stefan Kanev
05/20/12 12:15
Read: 490 times

#187446 - PLEASE, USE SMALL LETTERS, and ...
Responding to: ???'s previous message
second - let me try explain approach for Your task:

- You have buffer in memory , where user changes string.
- You send string to LCD on change or in regular time basis (for example to blinking cursor , or default position).
- You should have timer based counter - TIME_FROM_LAST_USER_ACTIVITY. This timer will be reloaded with some value, when user hits button. If non-zero - this timer should be decrmented by system timer ISR or by editing loop - on system tick.
- You track where is cursor in some variable .
- You remember last pressed button in variable - LASTBUTTON, You detect new button in variable NEWBUTTON.

- Suppose:
- Cursor is on first letter/position, no user input was done last few seconds, default charracter in buffer is 'G', TIME_FROM_LAST_USER_ACTIVITY=0.

Then Your loop :
B11) Your loop checks for keypressing and transition to zero of TIME_FROM_LAST_USER_ACTIVITY (which is zero at start)
If key is pressed - then go to B2, if timer goes to 0 - then go to B3.
Else stay here.

User pressed some button - for example 'ABCD2'.
Your software changes default charracter to first letter, associated with button,('A') ;
then reloads TIME_FROM_LAST_USER_ACTIVITY=0.5 (second). Changed string shoould be sended to LCD.
Button should be stored in variable LASTBUTTON.
Go to B1.
If (NEWBUTTON!=LASTBUTTON) { increment default cursor position, then go to B21};
If (NEWBUTTON==LASTBUTTON) { read what is default letter in buffer, search in table (assotiated with THIS
button), find next charracter in table and replace symbol.
restart timer, then goto to B1.};

Timer goes into 0- You should increment default cursor position, refresh LCD with repositioned cursor , then return to B1.

hope this helps a little bit

List of 4 messages in thread
alphanumeric keypad      Manoj Wakdikar      05/20/12 09:44      
   PLEASE, USE SMALL LETTERS, and ...      Stefan KAnev      05/20/12 12:15      
      Thank you regarding help      Manoj Wakdikar      05/26/12 10:59      
         Learn Anything?      Michael Karas      05/26/12 13:54      

Back to Subject List