Jump to content
C4 Forums | Control4

Driver programming question


niebais

Recommended Posts

Ok,

I've looked around the documentation and have finally decided I need to see if somebody else knows how to do this. I am in the process of programming a new driver which needs run continually and start when the control 4 system starts. How do I do that? I see a lot of drivers which require you to push a button or something similar, but this process doesn't need or require human interaction.

Link to comment
Share on other sites


All drivers that are loaded into a project 'start' when the Control4 system starts.

That is, their code gets executed when the driver is loaded by Director.

If you want your driver to do something after that code gets executed, you would typically set a timer in your Lua code, so your code would get executed at some point later, after the initialization.

RyanE

Link to comment
Share on other sites

Thanks for the quick reply! Ok, so I understand that I would add an event timer in my code somewhere like this: exitTimer = C4:AddTimer(1,"SECONDS",true).

Where would I put the timer?

I can only assume I would put it here:

function ExecuteCommand(strCommand, tParams)

Is there a specific command action I'm looking for on startup? For example, in this case I have a relay device.

Link to comment
Share on other sites

  • 5 months later...
  • 1 year later...
  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...