Interfacing BS2 to Keypad
TravisM
Posts: 7
I am in the process of developing a special purpose·phone system, similar to a standard phone unit with the pre-programmed one key dialing feature. I am trying to interface the BS2 to a keypad, with BS2 I/O pins P0 - P9 corresponding to the keypad keys 0 - 9, * to P10, # to P11.· My problem is in storing the numbers entered by the keypad in a manner that they can be used by the DTMFOUT PBASIC command. The DTMFOUT command wants the characters to be in groups of two, separated by commmas. The numbers are entered by the keypad one at a time. If you can help me with this code I would appreciate it.
Thank You.
Thank You.
Comments
Al little more information may be needed before we can offer much help. Who is the manufacturer of the keypad, or where did you buy it? How is the keypad encoded, or isn't it? Before you answer those questions though, read further, as your question may be answered differently below.
I'm not sure what you mean when you say "The DTMFOUT command wants the characters to be in groups of two, separated by commas". Here is a typical DTMFOUT command, and as you can see the tones are simple, single digit numeric values:
DTMFOUT 0, [noparse][[/noparse]1, 9, 1, 6, 6, 2, 4, 8, 3, 3, 3]
Alternatively, the tone parameters could be variables which are part of an array, like this:
DTMFOUT 0, [noparse][[/noparse]t(0), t(1), t(2), t(3), t(4), t(5), t(6), t(7), t(8), t(9), t(10)]
or just ordinary variables, like this:
DTMFOUT 0, [noparse][[/noparse]t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10]
The choice is yours, and all are valid forms of the DTMFOUT command. I suppose this may preclude your original question.
Regards,
Bruce Bates
I do not think that you can do it, because the phone system requires dual tones for each of the 16 digits (0-9 # * A B C D) in a high tone, low tone
format, where the last 4 tones ( A B C D ) are special keys. Comprised of a 4x(3or4) matrix of 8 distinct tones on a keypad....
Bob N9LVU
The DTMFOUT command takes care of the outbound DTMF dual-tone encoding, so I'm not sure I see your point. DTMFOUT is really nothing more than a special case of FREQOUT, which also permits dual tones to be generated.
Regards,
Bruce Bates
Ok, you're right, then it is doable depending upon what type of keypad matrix/connections he is using for his project...
Bob N9LVU
Thanks again, TravisM