I'm trying to add push-button control for an LED strip connected to my Arduino UNO. I want to be able to press the button once and the LED strip lights up and a second time to turn off the led strip. I've searched an attempted some of the searches I found. The LED Strip remains unaffected. However, the onboard LED would toggle on and off, even when the led strip pin was the one indicated. The code(Without push Button) is as follows
#include <bitswap.h>
#include <chipsets.h>
#include <color.h>
#include <colorpalettes.h>
#include <colorutils.h>
#include <controller.h>
#include <cpp_compat.h>
#include <dmx.h>
#include <FastLED.h>
#include <fastled_config.h>
#include <fastled_delay.h>
#include <fastled_progmem.h>
#include <fastpin.h>
#include <fastspi.h>
#include <fastspi_bitbang.h>
#include <fastspi_dma.h>
#include <fastspi_nop.h>
#include <fastspi_ref.h>
#include <fastspi_types.h>
#include <hsv2rgb.h>
#include <led_sysdefs.h>
#include <lib8tion.h>
#include <noise.h>
#include <pixelset.h>
#include <pixeltypes.h>
#include <platforms.h>
#include <power_mgt.h>
#define LED_PIN 12
#define NUM_LEDS 12
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
leds[0] = CRGB(255, 0, 0);
FastLED.show();
delay(500);
leds[1] = CRGB(0, 255, 0);
FastLED.show();
delay(500);
leds[2] = CRGB(0, 0, 255);
FastLED.show();
delay(500);
leds[3] = CRGB(0, 0, 255);
FastLED.show();
delay(500);
leds[4] = CRGB(0, 0, 255);
FastLED.show();
delay(500);
leds[5] = CRGB(150, 0, 255);
FastLED.show();
delay(500);
leds[6] = CRGB(0, 0, 255);
FastLED.show();
delay(500);
leds[7] = CRGB(0, 0, 255);
FastLED.show();
delay(500);
leds[8] = CRGB(0, 0, 255);
FastLED.show();
delay(500);
leds[9] = CRGB(255, 200, 20);
FastLED.show();
delay(500);
leds[10] = CRGB(0, 0, 255);
FastLED.show();
delay(500);
leds[11] = CRGB(0, 0, 255);
FastLED.show();
delay(500);
leds[12] = CRGB(0, 0, 255);
FastLED.show();
delay(500);
}