Jump to content

I need one switch to run a sequence of commands via DCS-BIOS


FlyingDouchman

Recommended Posts

I have my reasons 🙂

Think of this as a macro, flip one switch or hit a button on my panel and set off a chain of commands. I've been searching online for an hour and haven't found anyone discussing this, so... ¯\_(ツ)_/¯

 

It's clear I can have one switch run multiple functions simultaneously, but I can't figure out how to get a delay between each action. If this is possible, does anyone have a quick example?

 

Thanks!


Edited by FlyingDouchman
Link to comment
Share on other sites

You could digitalRead() your switch and send several sendDcsBiosMessage() as you want. Throw in some debouncing for good measure.

If you want quick and dirty you can use some millisecond delay() between each action, see here for inspiration: https://forums.eagle.ru/topic/117635-sending-messages-to-dsc-bios/?tab=comments#comment-2634648

 

If you want to go more advanced you could monitor in-game switch states to trigger the additional sendDcsBiosMessage() commands as appropriate - for example if you want to lift a switch cover first and wait to throw a toggle until it is open - or if you want to go through whatever sequence one switch at a time..


If you really need to have specific timed delay between actions, it would be better to use something like millis() and check against elapsed time to avoid stopping the code with the delay(); otherwise you can't do anything else while it waits. 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...