My LED's doesn't connect to my Arduino again, Is there something to do with the code?
int YPin = 9;
int BPin = 10;
int WPin = 11;
int GPin = 12;
int RPin = 13;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("!Happy Mothers Day!");
Serial.println("Look at the LED's");
pinMode(BPin,OUTPUT);
pinMode(WPin,OUTPUT);
pinMode(GPin,OUTPUT);
pinMode(RPin,OUTPUT);
pinMode(YPin,OUTPUT);
pinMode(SPin,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(RPin,HIGH);
delay(300);
digitalWrite(GPin,HIGH);
delay(300);
digitalWrite(WPin,HIGH);
delay(300);
digitalWrite(BPin,HIGH);
delay(300);
digitalWrite(YPin,HIGH);
delay(1000);
digitalWrite(RPin,LOW);
delay(300);
digitalWrite(GPin,LOW);
delay(300);
digitalWrite(WPin,LOW);
delay(300);
digitalWrite(BPin,LOW);
delay(300);
digitalWrite(YPin,LOW);
delay(1000);
digitalWrite(Wpin,High)
delay(300);
digitalWrite(Gpin,HIGH);
digitalWrite(Bpin,HIGH);
delay(300);
digitalWrite(Rpin,HIGH);
digitalWrite(Ypin,HIGH);
}
albert_wu1234:
My LED's doesn't connect
Not sure what that means @albert_wu1234 but anyway it won't compile as you posted:
you do a pinMode on "SPin" but haven't declared that yet, but anyway you don't digitalWrite to "SPin" so I commented the pinMode out
some of your Pins have become pins with lower case in the digitalWrites
one of the HIGH in digitalWrite is a High
one of the digitalWrites is missing its ;
Once those are fixed it works for me; as below:
int YPin = 9;
int BPin = 10;
int WPin = 11;
int GPin = 12;
int RPin = 13;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("!Happy Mothers Day!");
Serial.println("Look at the LED's");
pinMode(BPin, OUTPUT);
pinMode(WPin, OUTPUT);
pinMode(GPin, OUTPUT);
pinMode(RPin, OUTPUT);
pinMode(YPin, OUTPUT);
//pinMode(SPin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(RPin, HIGH);
delay(300);
digitalWrite(GPin, HIGH);
delay(300);
digitalWrite(WPin, HIGH);
delay(300);
digitalWrite(BPin, HIGH);
delay(300);
digitalWrite(YPin, HIGH);
delay(1000);
digitalWrite(RPin, LOW);
delay(300);
digitalWrite(GPin, LOW);
delay(300);
digitalWrite(WPin, LOW);
delay(300);
digitalWrite(BPin, LOW);
delay(300);
digitalWrite(YPin, LOW);
delay(1000);
digitalWrite(WPin, HIGH);
delay(300);
digitalWrite(GPin, HIGH);
digitalWrite(BPin, HIGH);
delay(300);
digitalWrite(RPin, HIGH);
digitalWrite(YPin, HIGH);
}
1 Like
You might have saved some time by the way, had you said that your code didn't compile and had provided the error codes, rather than just saying your LEDs wouldn't connect.
system
Closed
October 27, 2022, 12:09am
7
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.