| ??? 04/15/03 08:50 Read: times |
#43426 - Keypad Interpretation |
Hi all. I'm using a 4x3 matrix keypad for the input of floating point numbers into the uC. I'm using this procedure to interpret the values for the FP number:
1. Declare a variable called dec_counter 2. Detect whether a key is pressed. If not, repeat 2. 3. If the key is not '.' (decimal point or '#' (Enter), convert key to decimal value and increment dec_counter. 4. If the key is '.', stop incrementing dec_counter for subsequent loops. 5. If the key is '#' (Enter), go to step 6. Else repeat steps 2 to 5. 6. Depending on dec_counter, adjust values accordingly. Eg: If the keys 123.45 are pressed one at a time, i'll multiply 1 with 100, 2 with 10, 3 with 1, 4 with 0.1 and 5 with 0.01. 7. After that, I'll add all these values together to get the floating point number I want. This procedure is using a lot of overhead though. To get the floating point no, I need to do a lot of floating point multiplications and additions. Anyone has better ideas on how to interpret a floating point number that is input through a matrix keypad? Thanks |
| Topic | Author | Date |
| Keypad Interpretation | 01/01/70 00:00 | |
| RE: Keypad Interpretation | 01/01/70 00:00 | |
| RE: Keypad Interpretation | 01/01/70 00:00 | |
| RE: Keypad Interpretation | 01/01/70 00:00 | |
| RE: Keypad Interpretation | 01/01/70 00:00 | |
| RE: Keypad Interpretation - Tan | 01/01/70 00:00 | |
| RE: Keypad Interpretation - Tan | 01/01/70 00:00 | |
RE: Keypad Interpretation - Tan | 01/01/70 00:00 | |
| RE: Keypad Interpretation | 01/01/70 00:00 | |
| RE: Keypad Interpretation | 01/01/70 00:00 |



