Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: Bill_O on April 28, 2009, 09:00:07 AM
-
I have the following code in a button.
There are 4 buttons and I only want the one clicked on to have the led turned on.
Each button has 2 leds.
One is around the button and changes color and the other is a fake button that sits over a transparent button.
The led that is around the button always works.
The led that is a fake button usually does not change.
What am I doing wrong?
If (GetUserLED (1141) = 1) Then
SetUserLED (1141, 0)
Else
If (GetUserLED (1142) = 1) Then
SetUserLED (1142, 0)
Else
If (GetUserLED (1143) = 1) Then
SetUserLED (1143, 0)
End If
End If
End If
SetUserLED (1140 , 1)
Bill
-
The leds are either true or false, not 0 and 1. The "0" is 0, but the "1" is "non-zero" not necessarily 1.
Just try If GetUserLED(****) Then - or - If NOT GetUserLED(****) Then for the "on" or "off"
-
I thought I replied to this yesterday but must be going senile :(
It could be your buttons/led setup. I know Brett had a lot of trouble trying to put invisible buttons on top of LEDs etc
Hood
-
What Hood is referring to is this,
If you have a LED with a transparent button taking up the same screen space then you must assign a transparent png to the button.
Otherwise the LED will not show change of state reliably.
Greg
-
I think I did make and use a transparent png for the button but I will check.
Thanks everyone,
Bill