Using SigmaStudio 4.5 and ADAU1452 DSP. I am trying to setup an ABC test with one input and 3 outputs. I have a board with 3 momentary switches connected to 3 AUX ADC inputs. I'm using ADC inputs now because it's what I have available but eventually I will use GPIO or read from microcontroller via I2C.
Anyway, what I want to do is if one of the buttons are pressed it will activate that output and keep it on. If another button is pressed it will deactivate the currently active output and enable the selected output. Essentially, this is intended to operate like a relay board. Also, if the currently active channel is pressed again it will deactivate itself. However, I'm open to using a universal mute button instead, if that's easier.
It's easy to just add a Toggle On/Off block for each channel, but what's stumping me is how to check all the other toggle blocks and turn them off if they are on. I have an external index selected audio signal router setup with 4 mixes that routes the input (in this example a sine wave generator) to the respective output. Therefore, I've made it so that each control channel's output value is equal to the channel number. What's making this harder is I'm also hoping I can make this easily scalable for more or less outputs without having to change too much. I'm sure I could add a bunch of ABCD condition blocks but as I add channels that gets more complicated. Maybe I could also use a few logic blocks but I can't see how that could help me toggle off any active channels.
Am I fooling myself? Would it be simpler to just use a physical relay board and be done with it? Or is there an easy enough way to implement this in SigmaStudio?
Here's what I have right now:
[edited by: MattRobinson at 3:01 AM (GMT -4) on 27 Oct 2020]