Moving
This commit is contained in:
1
led_strip_door/README.md
Normal file
1
led_strip_door/README.md
Normal file
@ -0,0 +1 @@
|
||||

|
41
led_strip_door/led_strip_door.ino
Normal file
41
led_strip_door/led_strip_door.ino
Normal file
@ -0,0 +1,41 @@
|
||||
|
||||
// Define the pins for the LED strip
|
||||
#define RED 23
|
||||
#define GREEN 33
|
||||
#define BLUE 26
|
||||
|
||||
|
||||
void setup() {
|
||||
// Set the pins as outputs
|
||||
pinMode(RED, OUTPUT);
|
||||
pinMode(GREEN, OUTPUT);
|
||||
pinMode(BLUE, OUTPUT);
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
// Function that sets the color of the LED strip
|
||||
void setColor(int red, int green, int blue) {
|
||||
Serial.println("Setting color to: " + String(red) + ", " + String(green) + ", " + String(blue));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void loop() {
|
||||
// Set the color to red
|
||||
setColor(255, 0, 0);
|
||||
delay(1000);
|
||||
// Set the color to green
|
||||
setColor(0, 255, 0);
|
||||
delay(1000);
|
||||
// Set the color to blue
|
||||
setColor(0, 0, 255);
|
||||
delay(1000);
|
||||
// Set the color to white
|
||||
setColor(255, 255, 255);
|
||||
delay(1000);
|
||||
// Set the color to off
|
||||
setColor(0, 0, 0);
|
||||
delay(1000);
|
||||
}
|
||||
|
Reference in New Issue
Block a user