Basic Volume Control, variable problem
TUTech
Posts: 70
So I'm trying to do a basic volume control with a bar graph but I get an error. This is what I have.
Define_Device
dvBiamp = 5001:4:0
Define_Constant
Volume_Level_Max = 0
Volume_Level_Min = -100
Define_Variable
Non_Volatile SInterger snBargraphVolume[3]
BUTTON_EVENT [dvTP,41] //Volume Up
{
PUSH:
{
IF (snBargraphVolume < Volume_Level_Max); // Limit how high we increment
{
SEND_STRING dvBiamp, "VolumeUp"
snBargraphVolume++; // Increase value by 1
}
}
BUTTON_EVENT [dvTP,42] //Volume Down
{
PUSH:
{
IF (snBargraphVolume > Volume_Level_Min); // Limit how low we increment
{
SEND_STRING dvBiamp, "VolumeDn"
snBargraphVolume --; // Decrease value by 1
}
}
I get an error that says "Operators "+", "-", "/" and "*" are only allowed for 1 dimensional arrays. All I want to do is add 1 to the variable snBargraphVolume
Define_Device
dvBiamp = 5001:4:0
Define_Constant
Volume_Level_Max = 0
Volume_Level_Min = -100
Define_Variable
Non_Volatile SInterger snBargraphVolume[3]
BUTTON_EVENT [dvTP,41] //Volume Up
{
PUSH:
{
IF (snBargraphVolume < Volume_Level_Max); // Limit how high we increment
{
SEND_STRING dvBiamp, "VolumeUp"
snBargraphVolume++; // Increase value by 1
}
}
BUTTON_EVENT [dvTP,42] //Volume Down
{
PUSH:
{
IF (snBargraphVolume > Volume_Level_Min); // Limit how low we increment
{
SEND_STRING dvBiamp, "VolumeDn"
snBargraphVolume --; // Decrease value by 1
}
}
I get an error that says "Operators "+", "-", "/" and "*" are only allowed for 1 dimensional arrays. All I want to do is add 1 to the variable snBargraphVolume
0
Comments