im trying to make a traffic light . but the red lamp doesnt turn on . im giving it the right voltage and i put the anode and the cathode on the right place but doesnt turn on
heres the code
/*
* the soundy traffic light project
* 1. how to use the play func
* GREEN=10
* YELLOW=9
* RED=8
*/
int tones[10]={25,50,75,100,125,150,175,200,225,250};
int colorPin[3]={10,9,6};
void setup() {
// put your setup code here, to run once:
pinMode(11,OUTPUT);
}
void loop() {
reset();
light(1);
play(5);
delay(1000*45);
reset();
light(2);
delay(1000*5);
reset();
light(3);
play(5);
delay(1000*45);
}
void play(int tone){
analogWrite(11,tones[tone]);
delay(300*3);
digitalWrite(11,LOW);
}
void light(int color){
delay(100);
digitalWrite(colorPin[color-1],HIGH);
}
void reset(){
digitalWrite(10,LOW);
digitalWrite(9,LOW);
digitalWrite(8,LOW);
}