Am I doing this right? (programmer 1 newbie)
avi_dave
Posts: 62
I want to execute all this in one button push to turn a system basically can I just lay these out on a button event?
// system on routine
button_event [dvTP,10]
{
push:
{
on [dvrelay,screen_down]
wait 70
off [dvrelay,screen_down]
pulse [vdvVProj,27] //nec module (proj on)
wait 70
SEND_STRING dvSwth,'1*1!'
send_command vdvVProj, 'input-RGB,1'
}
}
// system on routine
button_event [dvTP,10]
{
push:
{
on [dvrelay,screen_down]
wait 70
off [dvrelay,screen_down]
pulse [vdvVProj,27] //nec module (proj on)
wait 70
SEND_STRING dvSwth,'1*1!'
send_command vdvVProj, 'input-RGB,1'
}
}
0
Comments
--John
Only this line of code will be delayed for 7 seconds
off [dvrelay,screen_down]
In the original posted code by avi_dave, these 2 lines will be delayed for 7 seconds:
off [dvrelay,screen_down]
SEND_STRING dvSwth,'1*1!'
It depends on what you want to do. The syntax is fine and the code will execute. I don?t know if it?s with the delays you expect.
If you want to use a WAIT to act upon more than one statement (one line of code), then you need to make it a compound statement by surrounding the statements within curly braces {}.
WAIT 70
{
//do this
//do that
//do the other thing
}
Yes you can lay it out in a button_event.
Code above does this:
1) Screen Down, Projector On
2) Wait 7 seconds
3) Send '1*1' to the switch, and change projector to RGB input
Original Code sent the change to RGB input too quickly.
Thanks for the catch Joe (again ).
--John
You missed stop screen down in step # 3 before sending 1*1 to the switch.
Happier now?