Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
#include <Adafruit_NeoPixel.h>
#include <SoftwareSerial.h>
#include <DFPlayerMini_Fast.h>
#define BUTTON_PIN 2
#define PIXEL_PIN 6 // Digital IO pin connected to the NeoPixels.
#define PIXEL_COUNT 16 // Number of NeoPixels
SoftwareSerial mySerial(10, 11); // RX, TX
DFPlayerMini_Fast myDFPlayer;
// Declare our NeoPixel strip object:
Adafruit_NeoPixel strip(PIXEL_COUNT, PIXEL_PIN, NEO_GRB + NEO_KHZ800);
boolean oldState = HIGH;
void setup() {
strip.begin(); // Initialize NeoPixel strip object (REQUIRED); // Initialize all pixels to 'off'
void blaster() {
myDFPlayer.volume(20); //set volume low; //play mp3 file with leading identifier "0001"
while(0); //halt
void loop() {
// Get current button state.
boolean newState = digitalRead(BUTTON_PIN);
// Check if state changed from high to low (button press).
if((newState == LOW) && (oldState == HIGH)) {
// Short delay to debounce button.
// Check if button is still low after debounce.
newState = digitalRead(BUTTON_PIN);
if(newState == LOW) { // Yes, still low
colorWipe(strip.Color(255, 0, 0), 7); // Red
colorWipe(strip.Color( 0, 0, 0), 2); // Black/off
// Set the last-read button state to the old state.
oldState = newState;
void colorWipe(uint32_t color, int wait) {
for(int i=0; i<strip.numPixels(); i++) { // For each pixel in strip...
strip.setPixelColor(i, color); // Set pixel's color (in RAM); // Update strip to match
delay(wait); // Pause for a moment