Hi here is the code I use to troubleshoot if anything in my setup works :
const int ledPin = 13;
const int red = 12;
const int yellow = 11;
const int green = 10;
const int red2 = 9;
const int yellow2 = 8;
const int green2 = 7;
const int red3 = 6;
const int yellow3 = 5;
const int green3 = 4 ;
const int red4 = 3;
const int yellow4 = 2;
const int green4 = 1;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(red, OUTPUT);
pinMode(yellow, OUTPUT);
pinMode(green, OUTPUT);
pinMode(red2, OUTPUT);
pinMode(yellow2, OUTPUT);
pinMode(green2, OUTPUT);
pinMode(red3, OUTPUT);
pinMode(yellow3, OUTPUT);
pinMode(green3, OUTPUT);
pinMode(red4, OUTPUT);
pinMode(yellow4, OUTPUT);
pinMode(green4, OUTPUT);
}
void loop(){
;int green = HIGH
;if (green == HIGH)
digitalWrite(green2,HIGH);
digitalWrite(red3,HIGH);
digitalWrite(red4,HIGH);
digitalWrite(green,HIGH);
digitalWrite(yellow,HIGH);
digitalWrite(yellow2,LOW);
digitalWrite(yellow3,HIGH);
digitalWrite(yellow4,LOW);
digitalWrite(green3,HIGH);
digitalWrite(green4,HIGH);
digitalWrite(red,LOW);
digitalWrite(red2,LOW);
}
At first this setup my led's only worked if I set them to LOW instead of High and now they don't seem to do anything, except that one led will brighten both on low or high. The 5v and GND is placed correctly and all the led's gets power and the legs are placed right. Can take a pic of the setup if necessary. How can I get this to work and is there something wrong with the code. When I try to add delay's the led's are activated in random patterns and seem to cause havoc among them. My teachers don't know how to correct this so is there someone who can ?