Home AMX User Forum NetLinx Studio

IR Basics

Hi

I went on the P1 course a few months back. The time has come to do my first project. I have the rs232 control that I need working. Its now time to do the IR. I have located the IR database which I need and mapped it to the port. Do I have to define the constant number relevant to what number it is in IR EDIT? this is the code I have then written. Is this the right way?

DEFINE_CONSTANT

//denon amp
denon_onoff = 9
denon_volume_up = 24
denon_volume_dwn = 25

DEFINE_EVENT

//denon button events
button_event[dvtp,28]
button_event[dvtp,29]
{
PUSH:
{
switch(button.input.channel)
{
case 28: pulse[dvIRAMP,denon_volume_dwn]
case 29: pulse[dvIRAMP,denon_volume_up]
}
}

}

On notifications I can see that the button I press is activating the correct channel, but it doesnt seem to be sending an IR signal out.

Any pointers would be helpful

Thanks

Dave

Comments

  • You won't see any IR output if the IR has not been loaded. As far as programming IR control, I like to use mapping arrays. You have an array of buttons to be used with the control of an IR device and match that with an identical array that has the correct IR channel. Then all you have to do is this...
    button_event[dvTP,nDVDbuttons]
    {
      push: pulse[dvDVD,DVDmap[get_last(nDVDbuttons)]
    }
    

    This allows you to use the same buttons over and over again. Just modify the map for different Models of DVD.
  • DHawthorneDHawthorne Posts: 4,584
    I've played around with various methods, and settled on making the button channel in my panel match the IR channel. So it you press button 3, for example, IR channel 3 goes out. Frankly, much of this is a holdover from G3 days when the panel could be edited in the field without loading anything; I've just gotten used to doing it that way. I do, however, run it all through a series of conditionals and/or switches to make sure the right device gets the commands, or they are blocked when it's not appropriate.
  • davecdavec Posts: 21
    cheers guys managed to get it sorted in the end. Hadnt learnt the codes properly! Basic Error!

    Thanks
Sign In or Register to comment.