Home AMX User Forum AMXForums Archive Threads Residential Forum

controlling 2 zones with 1 touch panel

Hey guys,
I am trying to control 2 zones using the same touch panel.. I am using AMX home.. I am able to control the volume in Zone 1 - Office, but unable to control the zone 2 MBR.. using an R4 with device id 10022
Volume code for Zone 1

BUTTON_EVENT[ROOMCONTROL2_MUSIC,51] //Volume Up
{
PUSH:
{
IF (MATRIX_ZONE_VOLUME[1] <= 255)
{
MATRIX_ZONE_VOLUME[1] = MATRIX_ZONE_VOLUME[1] + 5
send_level vdvMatrixAudio[1],1,MATRIX_ZONE_VOLUME[1]
}
}
}

BUTTON_EVENT[ROOMCONTROL2_MUSIC,52] //Volume Down
{
PUSH:
{
IF (MATRIX_ZONE_VOLUME[1] >= 0)
{
MATRIX_ZONE_VOLUME[1] = MATRIX_ZONE_VOLUME[1] - 5
send_level vdvMatrixAudio[1],1,MATRIX_ZONE_VOLUME[1]
IF (MATRIX_ZONE_VOLUME[1] >= 260)
{
MATRIX_ZONE_VOLUME[1] = 0
send_level vdvMatrixAudio[1],1,MATRIX_ZONE_VOLUME[1]
}
}
}
}

Volume control code for Zone 2

BUTTON_EVENT[ROOMCONTROL2_MUSIC,151] //Volume Up
{
PUSH:
{
IF (MATRIX_ZONE_VOLUME[2] <= 255)
{
MATRIX_ZONE_VOLUME[2] = MATRIX_ZONE_VOLUME[2] + 5
send_level vdvMatrixAudio[2],1,MATRIX_ZONE_VOLUME[2]
}
}
}
BUTTON_EVENT[ROOMCONTROL2_MUSIC,152] //Volume Down
{
PUSH:
{
IF (MATRIX_ZONE_VOLUME[2] >= 0)
{
MATRIX_ZONE_VOLUME[2] = MATRIX_ZONE_VOLUME[2] - 5
send_level vdvMatrixAudio[2],1,MATRIX_ZONE_VOLUME[2]
IF (MATRIX_ZONE_VOLUME[2] >= 260)
{
MATRIX_ZONE_VOLUME[2] = 0
send_level vdvMatrixAudio[2],1,MATRIX_ZONE_VOLUME[2]
}
}
}
}

any idea, wat cud be going wrong ??
Sign In or Register to comment.