Flasher ?
Hey guys,
I'm wondering what is the best way to make a button/relay/etc on-off flasher?
I came up with few models, but the code is too big for such a simple task. I believe you have better solutions.
For example if we need to flash button for a specific time. And for this time we have a variable: flasherTime = 8; // 8 is for 8/10 sec
Ideas?
I'm wondering what is the best way to make a button/relay/etc on-off flasher?
I came up with few models, but the code is too big for such a simple task. I believe you have better solutions.
For example if we need to flash button for a specific time. And for this time we have a variable: flasherTime = 8; // 8 is for 8/10 sec
Ideas?
0
Comments
So something like
So, the idea is that you just turn on the varialbe button_fb_enable whenever you want the button to flash.
Thanks
Hey Eric is been a while I havent hear from you.
Here is a simple code for blank screen that I was able to make with the help from Vinning, Eric, and Daniel.
(***********************************************************)
(* VARIABLE DEFINITIONS GO BELOW *)
(***********************************************************)
VOLATILE INTEGER FLASHER
VOLATILE INTEGER PROJECTOR_MUTE_STATUS
VOLATILE INTEGER nSource = 0
(***********************************************************)
(* THE EVENTS GO BELOW *)
(***********************************************************)
BUTTON_EVENT[dvTP,2] // System Off
{
PUSH:
{
SEND_STRING dvProjector,"$02,'POF',$03";
g_bProj_Main_Power = 0;
PROJECTOR_MUTE_STATUS = 0; //IT WOULD STOP FLASHING BUTTON
SEND_STRING dvSwitcher,"'7!',$0D";
BUTTON_EVENT[dvTP,55] //Shutter
{
PUSH:
{
PROJECTOR_MUTE_STATUS=!PROJECTOR_MUTE_STATUS;
IF (PROJECTOR_MUTE_STATUS)
{
SEND_STRING dvProjector,"$02,'OSH:1',$03";
}
ELSE
{
SEND_STRING dvProjector,"$02,'OSH:0',$03";
}
}
}
(***********************************************************)
(* THE ACTUAL PROGRAM GOES BELOW *)
(***********************************************************)
WAIT 7 // Changes the flasher state every .7 seconds
{
FLASHER=!FLASHER
}
[dvTP,55] = (PROJECTOR_MUTE_STATUS && FLASHER) // Flashes only if muted AND flashing enabled
You can also use a send command to set the button's feedback state to blink.
^BFB-1,On
^BFB-1,Off
^BFB-1,Blink
(1 is the button's address code in my example)
I have used use this extensively for projector lamp status as well as alarm system arming up status.
I will try it on m code, thanks