Multiple projector switching using variables?
dmenke
Posts: 25
Good Morning.
I have a classroom with 2 projectors, and need to be able to display multiple sources to each of the projectors at different times. I could create popup pages with different channel source buttons, and have multiple button events for each button unique to each projector, but I would like to be able to send a command to each projector based on which projector is selected on the projector select button.
Confused?
I'm using a module to control the projectors, and all that is working OK, I just want to choose the projector responding to a command with a variable set by a projector selector button. I was thinking of something like this: (I found this code elsewhere on the list, as an example)
DEFINE_DEVICE
dv_proj_1 = 5001:01:0 // proj one
dv_proj_2 = 5001:02:0 // proj two
DEFINE_VARIABLE
volatile dev dev_proj_sel[]=
{0,1}
volatile dev dev_projs[]=
{
dv_proj_1
,dv_proj_2
}
DEFINE_EVENT
button_event[dev_TP,1] // power on
{
push:
{
local_var integer pj_id
pj_id=get_last(dev_proj_sel)
send_command dev_projs[pj_id],'commence_world_takeover'
}
}
Is there a better way, or will this work?
Doug Menke
I have a classroom with 2 projectors, and need to be able to display multiple sources to each of the projectors at different times. I could create popup pages with different channel source buttons, and have multiple button events for each button unique to each projector, but I would like to be able to send a command to each projector based on which projector is selected on the projector select button.
Confused?
I'm using a module to control the projectors, and all that is working OK, I just want to choose the projector responding to a command with a variable set by a projector selector button. I was thinking of something like this: (I found this code elsewhere on the list, as an example)
DEFINE_DEVICE
dv_proj_1 = 5001:01:0 // proj one
dv_proj_2 = 5001:02:0 // proj two
DEFINE_VARIABLE
volatile dev dev_proj_sel[]=
{0,1}
volatile dev dev_projs[]=
{
dv_proj_1
,dv_proj_2
}
DEFINE_EVENT
button_event[dev_TP,1] // power on
{
push:
{
local_var integer pj_id
pj_id=get_last(dev_proj_sel)
send_command dev_projs[pj_id],'commence_world_takeover'
}
}
Is there a better way, or will this work?
Doug Menke
0
Comments
Or you could set a DEV variable and set it like so:
There are MANY different ways you can do this.
The 0 will act as a wildcard and will be true for any button pushed during the button event that jjames listed.
--John
--John
volatile dev dev_proj_sel[]=
{1,2}
to
volatile integer dev_proj_sel[]=
{1,2}
I'll just guess oversight on your part. But John is correct, the zero would act as a wildcard.
Good luck and let us know how it turns out!