Aha sorry, I was googling something different............
hence the new code should look like this?
int ranNum;
int switchPin = 2;
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
pinMode(switchPin, INPUT); // sets the digital pin as input to read switch
delay(100);
randomSeed(analogRead(0));
// Setup 8 output ports for LED's
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
}
void loop(){
ranNum=random(3,10);
digitalWrite(ranNum,HIGH);
delay(1000);
digitalWrite(ranNum,LOW);
delay(1000);}
OK so this has not changed anything.
The switched Input has to control when a single LED is turned on..............at the moment the program is changing them at a period determined by the delay in the program