by the_bluester on Wed May 24, 2017 10:21 pm
I had a look into my experimental setup that cancelled after ten flashes.
First up, I have a Function.flasher which is a flash with a 0.6 second on and 0.6 off time using the logic (PDM Battery voltage = True) that keeps all flashes synchronised, I used it in my headlight flasher as well.
Next I have functions to drive the indicators and hazard lights. Three of, Function.Indicators left, right and Hazard. The functions are toggles using the buttons I have assigned to the indicators and hazard lights. The two indicators have a false override of Function.indicators cancel (below)
Function.indicator cancel is a condition with the logic of ((Function.Indicator left = True AND Function.indicator right = True) OR (Function.Indicator Right= True AND function.Indicator left = True) OR (Function.Hazard lights = True) OR (Function.Indicator cancel counter = 10))
Function.indicator pulse, is a condition and has the logic of (Output.Indicators left = True OR Output.Indicators right = True) The output of that function us used by Function.Indicator cancel counter. Which is a counter, minimum of 0, max of 10, no wrap around, with a "constant 0" over ride using Function.indicator cancel counter zero.
Function.Indicator cancel counter zero is a condition, using the logic (Function.indicator left = False) OR (Function.indicator right false) OR (Function.Hazard lights false) OR (Function.Indicator cancel counter = 10 for 0.5 seconds)
The outputs are driven by a simple AND/OR arrangement. Left is driven by ((function.flasher = true AND Function.Indicators left = True) OR (Function.flasher = True AND Function.Hazard lights = True)) Likewise for the right indicators output, obviously with right substituted for left.
Long story, but the upshot is that if you press either indicator button the indicators will come on on that side, if you do nothing more they will stop after ten flashes. If you press the button again while it is flashing it will stop, if you press the button for the opposite indicator or for hazard lights it will stop and the new function will start. Hazard lights will run continuously and will not be cancelled by either indicator button, only a second press of the hazard lights button.
If you want more or less flashes than ten, you just need to change the max of the flash counter and the Function.Indicators cancel final logic to more or less than 10 on the counter.
I got the short press getting three flashes and a longer one ten going just to prove I could make different length button presses do different things but that is a whole other complication and I will probably not use it in the car. The only thing I plan to use that for is so I can use one button to run the wipers from off-int-low-high with one length press, high-low-int with a longer one and an even longer press for off from any speed. Possibly the same for a counter that I hope to use for variable boost control.