There are many code snippets on the forum for random numbers. This example is for a project Im doing that needs to randomly select 1 of 4 LED's. Im not too worried that its pseduo random but this code will get you a random number between 1 and 4 (but makes sure you dont get the same number twice...