-
Hi, in a project that uses digital, I have to create a custom component with pins in 2 directions (a data bus). The problem is that I don't know how to do it. I tried to use the "ObservableValue" class and to use the setBidirectional() method but it's still a bit messy and it doesn't work. Could you give me some advice or an example that could help me build my component ? I've already been able to make simple custom components (a 21 multiplexer, nand gate etc...) based on the MyOr or MyAnd examples. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can build the component as if the output was only output. |
Beta Was this translation helpful? Give feedback.
You can build the component as if the output was only output.
Then when the setBidirectional() method is called on this output, another additional input is passed to the setInputs() method.
You can use the additional input to read the value and the output to set the value.
You just have to make sure to set the output to high-z if the pin is to be used as input.