FlyingDouchman Posted December 7, 2020 Share Posted December 7, 2020 (edited) 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 December 7, 2020 by FlyingDouchman Link to comment Share on other sites More sharing options...
DeadMeat Posted December 7, 2020 Share Posted December 7, 2020 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. My mods --> Mil-spec upgrades for TM Warthog, Hornet & Cougar grips | Mil-spec upgrade for TM Warthog throttle | Real Tornado gear switch modded into gear and hook lever switches Link to comment Share on other sites More sharing options...
Recommended Posts