My code doesn't work all of the leds go on but they dont go off? (Question on image)O My code: const int ROOD = 12; const int BLAUW = 13; const int RGBROOD = 9; const int RGBBLAUW = 10; const int RGBGROEN = 11; int count1 = 0; int count2 = 0; int count3 = 0; int count4 = 0; void setup() { pinMode(ROOD, OUTPUT); pinMode(BLAUW, OUTPUT); pinMode(RGBROOD, OUTPUT); pinMode(RGBBLAUW, OUTPUT); pinMode(RGBGROEN, OUTPUT); } void loop() { delay(1000); count1 +=1; if (count1 == 5) { count1 -= 5; } count2 +=1; if (count2 == 6) { count2 -= 6; } count3 +=1; if (count3 == 4) { count2 -= 4; } count4 +=1; if (count4 == 7) { count4 -= 7; } if (count1 == 1) { digitalWrite(BLAUW, 1); } if (count1 > 6 && count1 < 1) { digitalWrite(BLAUW, 0); } if (count2 < 5) { digitalWrite(ROOD, 1); } if (count2 < 7 && count2 > 4) { digitalWrite(ROOD, 0); } if (count3 < 4) { digitalWrite(RGBROOD, 1); } if (count3 = 4) { digitalWrite(RGBROOD, 0); } if (count4 < 6) { digitalWrite(RGBGROEN, 1); } if (count4 < 8 && count4 > 5) { digitalWrite(RGBGROEN, 0); } if (count1 < 3) { digitalWrite(RGBBLAUW, 1); } if (count1 > 2 && count1 < 6) { digitalWrite(RGBBLAUW, 0); } }
My code doesn't work all of the leds go on but they dont go off? (Question on image)O My code: const int ROOD = 12; const int BLAUW = 13; const int RGBROOD = 9; const int RGBBLAUW = 10; const int RGBGROEN = 11; int count1 = 0; int count2 = 0; int count3 = 0; int count4 = 0; void setup() { pinMode(ROOD, OUTPUT); pinMode(BLAUW, OUTPUT); pinMode(RGBROOD, OUTPUT); pinMode(RGBBLAUW, OUTPUT); pinMode(RGBGROEN, OUTPUT); } void loop() { delay(1000); count1 +=1; if (count1 == 5) { count1 -= 5; } count2 +=1; if (count2 == 6) { count2 -= 6; } count3 +=1; if (count3 == 4) { count2 -= 4; } count4 +=1; if (count4 == 7) { count4 -= 7; } if (count1 == 1) { digitalWrite(BLAUW, 1); } if (count1 > 6 && count1 < 1) { digitalWrite(BLAUW, 0); } if (count2 < 5) { digitalWrite(ROOD, 1); } if (count2 < 7 && count2 > 4) { digitalWrite(ROOD, 0); } if (count3 < 4) { digitalWrite(RGBROOD, 1); } if (count3 = 4) { digitalWrite(RGBROOD, 0); } if (count4 < 6) { digitalWrite(RGBGROEN, 1); } if (count4 < 8 && count4 > 5) { digitalWrite(RGBGROEN, 0); } if (count1 < 3) { digitalWrite(RGBBLAUW, 1); } if (count1 > 2 && count1 < 6) { digitalWrite(RGBBLAUW, 0); } }
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
100%
My code doesn't work all of the leds go on but they dont go off? (Question on image)O
My code:
const int ROOD = 12;
const int BLAUW = 13;
const int RGBROOD = 9;
const int RGBBLAUW = 10;
const int RGBGROEN = 11;
int count1 = 0;
int count2 = 0;
int count3 = 0;
int count4 = 0;
void setup() {
pinMode(ROOD, OUTPUT);
pinMode(BLAUW, OUTPUT);
pinMode(RGBROOD, OUTPUT);
pinMode(RGBBLAUW, OUTPUT);
pinMode(RGBGROEN, OUTPUT);
}
void loop() {
delay(1000);
count1 +=1;
if (count1 == 5) {
count1 -= 5;
}
count2 +=1;
if (count2 == 6) {
count2 -= 6;
}
count3 +=1;
if (count3 == 4) {
count2 -= 4;
}
count4 +=1;
if (count4 == 7) {
count4 -= 7;
}
if (count1 == 1) {
digitalWrite(BLAUW, 1);
}
if (count1 > 6 && count1 < 1) {
digitalWrite(BLAUW, 0);
}
if (count2 < 5) {
digitalWrite(ROOD, 1);
}
if (count2 < 7 && count2 > 4) {
digitalWrite(ROOD, 0);
}
if (count3 < 4) {
digitalWrite(RGBROOD, 1);
}
if (count3 = 4) {
digitalWrite(RGBROOD, 0);
}
if (count4 < 6) {
digitalWrite(RGBGROEN, 1);
}
if (count4 < 8 && count4 > 5) {
digitalWrite(RGBGROEN, 0);
}
if (count1 < 3) {
digitalWrite(RGBBLAUW, 1);
}
if (count1 > 2 && count1 < 6) {
digitalWrite(RGBBLAUW, 0);
}
}
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY