Skip to content

Commit 1440610

Browse files
authored
Create README.md
1 parent 81ddab6 commit 1440610

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

rbb-led-4pin/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
This works
2+
int redPin= 7;
3+
int greenPin = 6;
4+
int bluePin = 5;
5+
6+
void setup() {
7+
pinMode(redPin, OUTPUT);
8+
pinMode(greenPin, OUTPUT);
9+
pinMode(bluePin, OUTPUT);
10+
}
11+
12+
void loop() {
13+
setColor(255, 0, 0); // Red Color
14+
delay(1000);
15+
setColor(0, 255, 0); // Green Color
16+
delay(1000);
17+
setColor(0, 0, 255); // Blue Color
18+
delay(1000);
19+
setColor(255, 255, 255); // White Color
20+
delay(1000);
21+
setColor(170, 0, 255); // Purple Color
22+
delay(1000);
23+
}
24+
25+
void setColor(int redValue, int greenValue, int blueValue) {
26+
analogWrite(redPin, redValue);
27+
analogWrite(greenPin, greenValue);
28+
analogWrite(bluePin, blueValue);
29+
}

0 commit comments

Comments
 (0)