Button Feed Back
josefino
Posts: 29
Good afternoon
My boss has asked for me to make the projector blank. I found the code and I created a button, so far good. But now i was asked by my boss to make the button flash when the button is pressed, to show the blank or shutter is on or enabled and to stop flashing whe is pressed again. Is there a way to do that? or to make the button turn green, when off or red when on or button pressed.
My boss has asked for me to make the projector blank. I found the code and I created a button, so far good. But now i was asked by my boss to make the button flash when the button is pressed, to show the blank or shutter is on or enabled and to stop flashing whe is pressed again. Is there a way to do that? or to make the button turn green, when off or red when on or button pressed.
0
Comments
one of the oldest tricks in the book. Here's a very simple way to do it.
I actually do this in a feedback timeline routine. But this method demonstrates how to do it.
Hope that helps.
Thank you for the replys, I tried the code and changing the button to blink, and I was not able to get it working. Most likely that I still new to programming. I can write symple code but when it comes to this I have dificulty. Is there anything else that I did not put on the code or something else I need to add, like at the Mutually exclusive, thanks
Also confrirm your port and channel number while you're there. Then put send_string 0' in your code to verify your code is triggering.
Today finally I got the code and the button to flash, I was going nuts, any way I had to email Billy my professor to check my code, and he was able to point were problem was. Also the button was to momentary, I changed to channel and it works, thanks eric and vining for the help and specially Billy.
BUTTON_EVENT[dvTP,87] //Shutter //TRIED TO MAKE IT FLASH
{
PUSH:
{
ON[dvTP,87]
PROJECTOR_MUTE_STAT=!PROJECTOR_MUTE_STAT //Billy added this line
SEND_STRING dvProjector,"$02,'OSH',$03";
}
}
(***********************************************************)
(* THE ACTUAL PROGRAM GOES BELOW *)
(***********************************************************)
DEFINE_PROGRAM
(*********************BUTTON FLASH********************************)
WAIT 7 //HERE IS WHERE I TRIED TO DEFINE TO FLASH
{
FLASHER=!FLASHER
[dvTP,87]=(FLASHER && PROJECTOR_MUTE_STAT) //parentesis
}
I just want to share what I found, since I'm not an expert, as many of you and I found many of the solutions for my problems here at this forum. I got the button flashing and it was great, but when I changed source the button stayed flashing, and for professors it was going to be confusing and it was going to be more trouble for us. Here is the code that I have just in case anybody needs it.
(***********************************************************)
(* THE EVENTS GO BELOW *)
(***********************************************************)
(* **************** NAVIGATION EVENTS **************** *)
BUTTON_EVENT[dvTP,3] // Page - PC
{ PUSH: { nCurrent_Nav = NAV_PC;
SEND_STRING dvSwitcher,"'7!',$0D";
SEND_STRING dvProjector,"$02,'IIS:RG1',$03";
WAIT 20 SEND_STRING dvProjector,"$02,'OAS',$03";
WAIT 7
PROJECTOR_MUTE_STATUS=0} } //HERE IS WHERE THE BUTTONS STOPS FLASHING
(* **************** PROJECTOR CONTROLS **************** *)
BUTTON_EVENT[dvTP,87] //Shutter
{
PUSH:
{
ON[dvTP,87] //SO IT WOULD TURN ON OR SHOW THE STATUS
PROJECTOR_MUTE_STATUS=!PROJECTOR_MUTE_STATUS
SEND_STRING dvProjector,"$02,'OSH',$03";
}
}
(***********************************************************)
(* THE ACTUAL PROGRAM GOES BELOW *)
(***********************************************************)
(********************************BUTTON FLASH COMMAND**********************)
WAIT 7
{
FLASHER=!FLASHER
[dvTP,87]=(FLASHER && PROJECTOR_MUTE_STATUS)
}
IF(PROJECTOR_MUTE_STATUS)
{
[dvTP,87]=FLASHER
}
Again I want to thank all the people that takes time to help and post the solutions for people like me.
Not to overwhelm you but the mute state should be set by a string returned from the device that says "hey, I'm mute" not because you pushed a button to send a command or change sources. Maybe that's too much to deal with for now but what you can do for now is create another var to track your current source based on a button push to indicate the current source selected ie, nSource = 1 (avr) , nSource = 2 (projector), etc, what ever numbers you want.
Then in your code: As long as you set nSource when you push a button to select a different source you button will stop flashing when not on the projector and start flashing when on the projector if muted. All other times it will reflect the correct projector mute state.
You probably already have a var to track your current source so this should be easy to do and it doesn't require you to do a bunch of crap you're not ready for.
You are right Vinning, the buton sometims is flashing and the projector is not in mute. I will try the code and the suggestions you stated, thanks for the info and pointing the problem.