I'm trying to code something that changes a certain output, after a certain input is sensed. Please see the tables below for a better explanation.
| If 5V input Sensed on: | Then Output 5v on: | | - | - | | A1 | D1 | | A2 | D2 | | A3 | D3 | | A4 | D4 |
Now, if I hit reset, I want my program to randomize the output for an input within an array of say [D1,D2,D3,D4,D5,D6] without using an output more than once.
| If 5V input Sensed on: | Then Output 5v on: | | - | - | | A1 | D4 | | A2 | D6 | | A3 | D1 | | A4 | D2 |
I know I need to make all of this happen during the setup() function and in python I'm sure I'd used a dictionary to setup the key:value pair of input:output. Are there analogous data types to python dictionary in c++ that I could use to help solve this problem?
Thanks for the help.