Home AMX User Forum AMX General Discussion
Options

user keypad

Hello All
I have a client who wanted a custom keypad design. I have it done but am having troubles getting the data from it to the device. The device is an Extron AVT100N tuner. I have the ch up/dn working and the feedback to the channel display working now(thx's Joe) but the input from this keypad is incorrect. Here is some of what I have.

BUTTON_EVENT [VTP,TP_CH_KEYPAD]
{
PUSH:
{
LOCAL_VAR CHAR CHAN[3]
STACK_VAR INTEGER B,P
B=GET_LAST(TP_CH_KEYPAD)
P=GET_LAST(VTP)
SWITCH (B)
{
CASE 1 :
CASE 2 :
CASE 3 :
CASE 4 :
CASE 5 :
CASE 6 :
CASE 7 :
CASE 8 :
CASE 9 :
CASE 10:
CHAN="CHAN,ITOA(B-10)"
CASE 11:
{
SEND_STRING TUNER,"CHAN,'*6#'"
SEND_COMMAND VTP,"'TEXT13-',CHAN"
CHAN=''
}
CASE 12:CHAN=''
}

}
}

What's happening is when I select channel 5 it isn't working, channel "05" is going to channel 65 and channel "005" gives me channel 6,

Comments

  • Options
    Joe HebertJoe Hebert Posts: 2,159
    Hi Thomas,

    The line:
    CHAN="CHAN,ITOA(B-10)"
    looks incorrect as it will result in negative numbers for keys 1-9.

    I believe you want:
    CHAN="CHAN,ITOA(10-B)"

    HTH
  • Options
    Thx's Joe. I had to do a couple of changes to the code to get it to work.
Sign In or Register to comment.