Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

LED+Strip - Creating Dynamic Lighting Effects with Arduino

The Importance and Utility of LED+Strip

LED+Strip is a popular component used in various applications, ranging from home automation to stage lighting. It consists of a flexible circuit board with multiple addressable RGB LEDs, allowing for the creation of dynamic lighting effects. This technology offers versatility, energy efficiency, and ease of control, making it an excellent choice for both hobbyists and professionals.

Project: Creating a Color-Changing Ambience Light

In this example project, we will create a color-changing ambience light using an Arduino board and an LED+Strip. The objective is to design a light that can cycle through different colors and brightness levels, providing a soothing and visually appealing atmosphere.

List of Components:

  1. Arduino Uno - 1x (https://www.arduino.cc/en/Main/ArduinoBoardUno)
  2. LED+Strip - 1x (https://www.sparkfun.com/products/12025)
  3. Jumper wires - as required
  4. Breadboard - 1x (https://www.sparkfun.com/products/12615)
  5. Power supply - 1x (https://www.sparkfun.com/products/12867)

Examples:

Example 1: Controlling LED Strip with Arduino

#include <Adafruit_NeoPixel.h>

#define LED_PIN 6
#define LED_COUNT 60

Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  strip.begin();
  strip.show(); // Initialize all pixels to off
}

void loop() {
  for (int i = 0; i < LED_COUNT; i++) {
    strip.setPixelColor(i, strip.Color(255, 0, 0)); // Set color to red
    strip.show();
    delay(100);
    strip.setPixelColor(i, 0); // Turn off the LED
    strip.show();
    delay(100);
  }
}

Example 2: Color Fading Effect

#include <Adafruit_NeoPixel.h>

#define LED_PIN 6
#define LED_COUNT 60

Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  strip.begin();
  strip.show(); // Initialize all pixels to off
}

void loop() {
  for (int i = 0; i < LED_COUNT; i++) {
    for (int j = 0; j <= 255; j++) {
      strip.setPixelColor(i, strip.Color(j, 0, 0)); // Fade from off to red
      strip.show();
      delay(10);
    }
    for (int j = 255; j >= 0; j--) {
      strip.setPixelColor(i, strip.Color(j, 0, 0)); // Fade from red to off
      strip.show();
      delay(10);
    }
  }
}

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.