PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Oct 08, 2008 5:40 pm |
|
|
1. Put the incoming characters from the keypad into an array.
Make sure you don't write beyond the end of the array.
2. When the user presses the '#' key, this marks the end of the data.
Write a 0x00 to the end of the data in the array, when you get this key.
This will make the ASCII numbers into a string.
3. Now use the atoi() or atol() function to convert the numeric string
in the array into an integer. Those functions are in this file. You need
to #include it in your program:
Quote: | c:\program files\picc\drivers\stdlib.h |
|
|