Random function

robtillaart:
An often used initializer for randomSeed is analogRead(A0) with A0 connected to nothing. It is still not really random (it will fail on real random tests) but for many applications it is random enough.

Another option is to use a button and use micros()/4 to initialize the random seed if the key is pressed and/or released.

can you show me the code please as im new to arduino thanks