33 views
0
0 Comments

Hello, I wrote you 2 weeks before. I tried to do a a script, but only few lights switch on, not everystep. Can you check my script?

int schod1 =1; // initialize digital pin 4.
int schod2 =2; // initialize digital pin 3.
int schod3 =3; // initialize digital pin 2.
int schod4 =4; // initialize digital pin 1.
int schod5 =5; // initialize digital pin 5.
int schod6 =6; // initialize digital pin 6.
int schod7 =7; // initialize digital pin 7.
int schod8 =8; // initialize digital pin 8.
int schod9 =9; // initialize digital pin 4.
int schod10 =10; // initialize digital pin 3.
int schod11 =11; // initialize digital pin 2.
int schod12 =12; // initialize digital pin 1.
int schod13 =13; // initialize digital pin 5.
int schod14 =14; // initialize digital pin 6.
int schod15 =15; // initialize digital pin 7.
int schod16 =16; // initialize digital pin 8.
void setup()
{
pinMode(schod1, OUTPUT);// set the pin with red LED as “output”
pinMode(schod2, OUTPUT); // set the pin with yellow LED as “output”
pinMode(schod3, OUTPUT); // set the pin with green LED as “output”
pinMode(schod4, OUTPUT); // set the pin with black LED as “output”
pinMode(schod5, OUTPUT);// set the pin with red LED as “output”
pinMode(schod6, OUTPUT); // set the pin with yellow LED as “output”
pinMode(schod7, OUTPUT); // set the pin with green LED as “output”
pinMode(schod8, OUTPUT); // set the pin with black LED as “output”
pinMode(schod9, OUTPUT);// set the pin with red LED as “output”
pinMode(schod10, OUTPUT); // set the pin with yellow LED as “output”
pinMode(schod11, OUTPUT); // set the pin with green LED as “output”
pinMode(schod12, OUTPUT); // set the pin with black LED as “output”
pinMode(schod13, OUTPUT);// set the pin with red LED as “output”
pinMode(schod14, OUTPUT); // set the pin with yellow LED as “output”
pinMode(schod15, OUTPUT); // set the pin with green LED as “output”
pinMode(schod16, OUTPUT); // set the pin with black LED as “output”
}
void loop()
{
digitalWrite(schod8, HIGH); // set the LED on.
digitalWrite(schod9, HIGH); // set the LED on.
delay(1000); // wait for a second.
digitalWrite(schod7, HIGH); // set the LED on.
digitalWrite(schod10, HIGH); // set the LED on.
delay(1000); // wait for a second.
digitalWrite(schod6, HIGH); // set the LED on.
digitalWrite(schod11, HIGH); // set the LED on.
delay(1000); // wait for a second.
digitalWrite(schod5, HIGH); // set the LED on.
digitalWrite(schod12, HIGH); // set the LED on.
delay(1000); // wait for a second.
digitalWrite(schod4, HIGH); // set the LED on.
digitalWrite(schod13, HIGH); // set the LED on.
delay(1000); // wait for a second.
digitalWrite(schod3, HIGH); // set the LED on.
digitalWrite(schod14, HIGH); // set the LED on.
delay(1000); // wait for a second.
digitalWrite(schod2, HIGH); // set the LED on.
digitalWrite(schod15, HIGH); // set the LED on.
delay(1000); // wait for a second.
digitalWrite(schod1, HIGH); // set the LED on.
digitalWrite(schod16, HIGH); // set the LED on.
delay(1000); // wait for a second.
}

Thank you for help, Stepan Janda jandastepan82@gmail.com

Answered question

2 Answers

Stepan (anonymous) 0 Comments

When I tried it with a LEDs only on Arduino UNO it worked perfect. Can anybody help me? Thank you

Answered question
You are viewing 1 out of 2 answers, click here to view all answers.
Write your answer.