??? 05/20/12 18:15 Read: times |
#187446 - PLEASE, USE SMALL LETTERS, and ... Responding to: ???'s previous message |
second - let me try explain approach for Your task:
A) - 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. B) - 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. B2) User pressed some button - for example 'ABCD2'. IF TIME_FROM_LAST_USER_ACTIVITY==0 then {B21) 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. } ELSE //TIME_FROM_LAST_USER_ACTIVITY!=0 {B22) 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.}; } B3) 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 regards |
Topic | Author | Date |
alphanumeric keypad | 01/01/70 00:00 | |
PLEASE, USE SMALL LETTERS, and ... | 01/01/70 00:00 | |
Thank you regarding help | 01/01/70 00:00 | |
Learn Anything? | 01/01/70 00:00 |