This commit is contained in:
2024-03-14 18:01:57 +01:00
parent fa9328c8bf
commit 254b9379a5
22 changed files with 893 additions and 1 deletions

1
led_strip_door/README.md Normal file
View File

@ -0,0 +1 @@
![WIRE](https://cdn.sparkfun.com/assets/learn_tutorials/7/9/0/Non_Addressable_LED_Strip_Simple_bb_Fritzing.png)

View 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);
}