My Daft Punk Guy Helmet project.. im stuck

Hello and thank you for reading.

Currently I have been following the steps from the videos that estafannie posted on youtube, however there were a lot of steps left out, it seemed to be more of a demonstration. However a shopping list and files were provided by her.

As it stands I am unable to have it fully functioning. I have attempted to omit the audio and microphone options, I only wish to turn on the battery pack, and have the python script work with the arduino file/sketch and just run through the light sequences as listed in the file.

To give a demonstration of where I am at, I have put together a small video. HERE

Here is where I am confused, Im told that I have to use the python script (From HERE) with the .ino code.

/* DAFT PUNK HELMET
 *  
 * Have fun =)
 *
 * This file is part of the Estefannie Explains It All repo.
 *
 * (c) Estefannie Explains It All <estefannieexplainsitall@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

#include <Wire.h>
#include <FastLED.h>
#include "SparkFun_Qwiic_Twist_Arduino_Library.h"
TWIST twist; //create instance of this object

#define DATA_LEFTEAR_PIN 1
#define DATA_RIGTHEAR_PIN 2
#define DATA_RIGHT_PIN 3
#define DATA_LEFT_PIN 7
#define BUTTON 4
#define TWIST A0

// Params for width and height
const uint8_t kMatrixWidth = 4;
const uint8_t kMatrixHeight = 8;
const bool    kMatrixSerpentineLayout = true;

#define NUM_LEDS (kMatrixWidth * kMatrixHeight)
#define NUM_LEDONE 1

// Calculates position on string based on coordinates
uint16_t XY( uint8_t x, uint8_t y)
{
  uint16_t i;
  
  if( kMatrixSerpentineLayout == false) {
    i = (y * kMatrixWidth) + x;
  }

  if( kMatrixSerpentineLayout == true) {
    if( y & 0x01) {
      // Odd rows run backwards
      uint8_t reverseX = (kMatrixWidth - 1) - x;
      i = (y * kMatrixWidth) + reverseX;
    } else {
      // Even rows run forwards
      i = (y * kMatrixWidth) + x;
    }
  }
  
  return i;
}

// Define the array of leds
CRGB led_array[NUM_LEDS];
CRGB led_ears[NUM_LEDONE];
int boardLed = 13;

void setup()
{
    Serial.begin(9600);
    pinMode(boardLed, OUTPUT);
    pinMode(BUTTON, INPUT);
    pinMode(TWIST, INPUT);
    FastLED.addLeds<WS2812B, DATA_LEFT_PIN, GRB>(led_array, NUM_LEDS);
    FastLED.addLeds<WS2812B, DATA_RIGHT_PIN, GRB>(led_array, NUM_LEDS);
}

char readIn;

void clear()
{
    for (int i = 0; i < NUM_LEDS; i++)
    {
        led_array[i] = CRGB::Black;
    }
    FastLED.show();
}

void fadeall() { for(int i = 0; i < NUM_LEDS; i++) { led_array[i].nscale8(250); } }

void cylon()
{
  static uint8_t hue = 0;

  // First slide the led in one direction
  for(int i = 0; i < NUM_LEDS; i++)
    {
    led_array[i] = CHSV(hue++, 255, 255);

    FastLED.show(); 

    fadeall();

    delay(10);
  }

  // Now go in the other direction.  
  for(int i = (NUM_LEDS)-1; i >= 0; i--)
    {
    led_array[i] = CHSV(hue++, 255, 255);
    FastLED.show();

    fadeall();

    delay(10);
  }
}

void lightRow(int row, CRGB color)
{
    for (int i = 0; i < kMatrixWidth; i++)
    {
        led_array[XY(i, row)] = color;                
    }
    FastLED.show();
}

CRGB rainbow[8] = {CRGB::Purple, CRGB::Blue, CRGB::PowderBlue,
                   CRGB::Green, CRGB::LightGreen, CRGB::Yellow,
                   CRGB::Orange, CRGB::Red};

void lightRows(int rows, CRGB color)
{
    for (int i = 0; i < rows; i++)
    {
        lightRow(i, color);
    }
}

void fullColor(CRGB color) // this works
{
    lightRows(kMatrixHeight, color);
}

void fullonRainbow() // this works
{
    for (int i = 0; i < kMatrixHeight; i++)
    {
        lightRow(i, rainbow[i]);
    }
}

void rainbowDrop()
{
    // drop in
    for (int i = 0; i < kMatrixHeight; i++)
    {
        CRGB currentColor = rainbow[kMatrixHeight - i];
        
        int currentPosition = kMatrixHeight;
        int previousPosition = currentPosition + 1;

        while(currentPosition > i)
        {
            currentPosition = currentPosition - 1;
            previousPosition = currentPosition + 1;

            lightRow(currentPosition, currentColor);
            if (previousPosition <= (kMatrixHeight - 1))
            {
                lightRow(previousPosition, CRGB::Black);
            }
            FastLED.show();
            delay(100);          
        }
    }

    // clear out
    for (int i = 0; i < kMatrixHeight; i++)
    {
        CRGB currentColor = rainbow[kMatrixHeight - i];
        
        int currentPosition = i;
        int previousPosition = currentPosition - 1;

        while(currentPosition >= -1)
        {
            currentPosition = currentPosition - 1;
            previousPosition = currentPosition + 1;

            if (currentPosition != -1)
            {
                lightRow(currentPosition, currentColor);
            }
            lightRow(previousPosition, CRGB::Black);

            FastLED.show();
            delay(100);          
        }
    }
}

int cycleColor = 0;
void rainbowCycle()
{
    CRGB currentColor = rainbow[cycleColor];
    cycleColor++;

    if (cycleColor > 7)
    {
        cycleColor = 0;
    }

    int currentPosition = kMatrixHeight;
    int previousPosition = currentPosition + 1;

    while(currentPosition > -1)
    {
        currentPosition = currentPosition - 1;
        previousPosition = currentPosition + 1;

        if (currentPosition > -1)
        {
            lightRow(currentPosition, currentColor);            
        }
        if (previousPosition <= (kMatrixHeight - 1))
        {
            lightRow(previousPosition, CRGB::Black);
        }
        FastLED.show();
        delay(100);          
    }
}

void bounce()
{
    CRGB currentColor = rainbow[cycleColor];
    cycleColor++;

    if (cycleColor > 7)
    {
        cycleColor = 0;
    }

    int bounceDistance = 3;
    int bottomArray[] = {0, 1, 2};
    int topArray[] = {kMatrixHeight - 1,  kMatrixHeight - 2, kMatrixHeight -3};

    for (int i = 0; i < bounceDistance; i++)
    {
        lightRow(topArray[i], currentColor);    
        lightRow(bottomArray[i], currentColor);
        FastLED.show();
        delay(100);       
    }

    for (int i = bounceDistance; i >= 0; i--)
    {
        lightRow(topArray[i], CRGB::Black);    
        lightRow(bottomArray[i], CRGB::Black);
        FastLED.show();
        delay(100);       
    }
}

enum Mode
{
    Solid,
    Animation1,
    Animation2,
    Animation3,
    Animation4
};


          

    // repeat modes
    void loop()  {

{
     Animation1:
    {
        cylon();
        delay(1000);
    }
     Animation2:
    {
        clear();
        bounce();
        clear();
        bounce();
        delay(1000);
       
    }
     Animation3:
    {
        clear();
        rainbowDrop();
        clear();
        rainbowDrop();
        clear();
        delay(1000);
    }
     Animation4:
    {
        clear();
        rainbowCycle();
        clear();
        rainbowCycle();
        delay(1000);

    }
}
}

For a brief time I was receiving a little bit of guidance from estafannie. However I havent heard anything from her for a few days so I thought I would reach out here. Plus I am still learning.

A friend had this for a couple of months and he finally threw in the towel. So I picked up the towel and what you see here is where I am at.

btw, the POT that I purchased is not hooked up, it is different from the one that was suggested to buy so I just left it disconnected.

I appreciate any help I can acquire with this, im pretty much at anyone's mercy to assist me since I am unable to contact estafannie.

Thanks for reading,.

Felixx

Code tags on your first post! Karma++

I do not see a clear description of your issue. Many forum members are not going to watch a 10 minute video to determine what you are trying to do and what you want help with.

Can you write a description of what you expected to happen and what actually happened for us.

Agreed. And we need schematics, or at least a block diagram to start with, list of components (with links to the data sheets of any non-basic components).

Arduino cannot run python scripts. Is there a raspberry pi or something similar in the mix here? I saw something like a pi in the video before I got bored and stopped watching.

You mentioned a POT. Is this an acronym for something or did you just mean "pot" as an abbreviation for potentiometer? The component in the video with a knob was not a pot, in pretty sure. More like a rotary encoder.

vinceherman:
Code tags on your first post! Karma++

I do not see a clear description of your issue. Many forum members are not going to watch a 10 minute video to determine what you are trying to do and what you want help with.

Can you write a description of what you expected to happen and what actually happened for us.

Im sorry but I do not know what "Code tags" means.

Here is the description:

When I turn on my battery pack, the lights are not running as shown in the video in which I provided. The video demonstrated the only way to get them to work, which is not favorable. Simply turning the power on, is what is.

When I mentioned a "POT" you are correct assuming that it is a potentiometer. I overestimated and assumed that people here would know the meaning. I will be more descriptive moving forward.

My parts list are the following:

WS2812b LED strip, 60/meter, cut up into strips of 4 LEDs and wired together, mounted in light bars

SparkFun Qwiic Twist - RGB Rotary Encoder Breakout (currently not hooked up)

An ATmega328p microcontroller

DragonBoard 410C

96 boards sensor mezzanine

The dragonboard and the mezz are connected together, The lights are plugged into the mezz. Everything is changed so that the 8 AA batteries power everything.

I have an hdmi plugged in as well as a keyboard and mouse so that I can work on setting it up. Arduino is installed.

What you see in the video that I have provided is the display from the dragonboard.

Please be very patient with me, im a complete newbie and my brain is fried from trying to understand it. The guy that was helping me just "gave up". So now im left with asking for help.

If I leave something out, or I dont type something correctly, please be a little forgiving.

If it helps, this is the video I have been trying to follow:

If the python script is just something for the audio, then I guess Ill just leave it out. This is what I was told when I asked why the lights wont start up when I turn the battery pack on:

"You just seem to be missing the Python script which is what runs at boot and works with the .ino code.All you need to do is to have the python start up at start-up"

My desired goal is to simply turn it on, and have it run like in the video I posted earlier. but for some reason, the only way I can do that, is by hooking it up to a monitor Open Arduino and click Tools>Serial Monitor

As seen here: https://youtu.be/ZA-rJeo9ZVM?t=132

Please tell me whatever else is needed I will do my best to provide. THanks again

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html .

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
This is essential at this point as you are showing a circuit configuration problem.

How are you powering your 2812 LEDs?
What model Arduino are you using?
The Arduino is powered through the USB cable, How are you powering the Arduino with the USB disconnected?
Check ALL your gnd connections.

Each time you open the serial monitor, the Arduino is automatically RESET.

Thanks.. Tom.. :slight_smile:

I appreciate everyone offering to help.

What I actually did to make it work was remove the mezz and the dragonboard and replaced it with a UNO board.

Made a few changes to the ino file, uploaded the sketch and everything works perfectly. Im so happy.

:slight_smile:

Cheers everyone