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