Can you help me??? I have an error in my code and I don´t know how to solve it:
int LED1=4;
int SPEAKER1 =6;
const int cant_both =2;
const int cant_cues =3;
int BOTH1 [cant_both]={LED1, SPEAKER1};
int CUES1 [cant_cues] = {LED1, SPEAKER1, BOTH1};
The idea is to turn ON randomly an LED, SPEAKER or BOTH, but I cannot put an array inside another array :~
Its because you are mixing types. an array of the type int can only hold integer values.
I don't really understand what you are trying to do, so I cant help you any more. You could declare it as an array of arrays and have LED and SPEAKER be an array with length 1.
The name of an array is a pointer. So you tried to place a pointer in an array that was expecting an int. There are ways to do it but I don't think you need to.
Your randomness is basically a coin toss. Heads the LED or speaker is on, tails it isn't. So as you go through loop() toss a coin and decide whether you want the LED on and then do the same with the speaker. This will make the combination of the two random enough.
How you wish to toss the coin is up to you. Generate a random 0 or 1 or generate a random in a larger range and check whether it is odd or even. Whatever makes you feel good.