<commit_before>#define __ASSERT_USE_STDERR

#include "pixelmap/pixelmap.h"
#include <Assert.h>
#include <FastLED.h>
#include <Logging.h>

#define LOGLEVEL LOG_LEVEL_INFOS

#define BRIGHTNESS 150

#define STAFF_LEDS 100
#define RING_LEDS 12

#define BUTTON_PIN 5
#define STAFF_PIN 6
#define RING_PIN 7

using namespace pixelmap;

RandomInput input = RandomInput();
LEDStrip staff = LEDStrip(STAFF_LEDS);
LEDStrip ring = LEDStrip(RING_LEDS);

LEDStrip* strips[] = {&staff, &ring};
int starts[] = {0, 0};
int lengths[] = {STAFF_LEDS, RING_LEDS};

LEDs leds = LEDs(2, strips, starts, lengths, true);

Visualization* viz;
Animation* anim;

ButtonInput button = ButtonInput(BUTTON_PIN);

int currentAnimation = 0;
bool firstRun = true;

void setup() {
  Log.Init(LOGLEVEL, 9600);
  Log.Info("setup()");

  FastLED.addLeds<NEOPIXEL, STAFF_PIN>(staff.leds, STAFF_LEDS);
  FastLED.addLeds<NEOPIXEL, RING_PIN>(ring.leds, RING_LEDS);
  FastLED.setBrightness(BRIGHTNESS);
  FastLED.show();

  Log.Debug("Finished setup()");
}

void loop() {
  Looper* looper = Looper::instance();

  if (button.getInput() > 0.5 || firstRun == true) {
    Log.Info("Button press detected");
    switch(currentAnimation) {
      case 0:
        Log.Info("Switching to Disco animation");
        looper->clearAll();
        delete viz;
        delete anim;
        viz = new NullVisualization(&input, STAFF_LEDS);
        anim = new DiscoAnimation(viz, leds);
        looper->addInput(&input);
        looper->addVisualization(viz);
        looper->addAnimation(anim);
        currentAnimation = 1;
        break;
      case 1:<commit_msg>Added the twinkle animation to the LED staff<commit_after>#define __ASSERT_USE_STDERR

#include "pixelmap/pixelmap.h"
#include <Assert.h>
#include <FastLED.h>
#include <Logging.h>

#define LOGLEVEL LOG_LEVEL_INFOS

#define BRIGHTNESS 150

#define STAFF_LEDS 100
#define RING_LEDS 12

#define BUTTON_PIN 5
#define STAFF_PIN 6
#define RING_PIN 7

using namespace pixelmap;

RandomInput input = RandomInput();
LEDStrip staff = LEDStrip(STAFF_LEDS);
LEDStrip ring = LEDStrip(RING_LEDS);

LEDStrip* strips[] = {&staff, &ring};
int starts[] = {0, 0};
int lengths[] = {STAFF_LEDS, RING_LEDS};

LEDs leds = LEDs(2, strips, starts, lengths, true);

Visualization* viz;
Animation* anim;

ButtonInput button = ButtonInput(BUTTON_PIN);

int currentAnimation = 0;
bool firstRun = true;

void setup() {
  Log.Init(LOGLEVEL, 9600);
  Log.Info("setup()");

  FastLED.addLeds<NEOPIXEL, STAFF_PIN>(staff.leds, STAFF_LEDS);
  FastLED.addLeds<NEOPIXEL, RING_PIN>(ring.leds, RING_LEDS);
  FastLED.setBrightness(BRIGHTNESS);
  FastLED.show();

  Log.Debug("Finished setup()");
}

void loop() {
  Looper* looper = Looper::instance();

  if (button.getInput() > 0.5 || firstRun == true) {
    Log.Info("Button press detected");
    switch(currentAnimation) {
      case 0:
        Log.Info("Switching to Twinkle animation");
        looper->clearAll();
        delete viz;
        delete anim;
        viz = new TwinkleVisualization(&input, STAFF_LEDS);
        anim = new PassThroughAnimation(viz, leds);
        looper->addInput(&input);
        looper->addVisualization(viz);
        looper->addAnimation(anim);
        looper->setUpdatesPerSecond(50);
        currentAnimation = 1;
        break;
      case 1:
        Log.Info("Switching to Disco animation");
        looper->clearAll();
        delete viz;
        delete anim;
        viz = new NullVisualization(&input, STAFF_LEDS);
        anim = new DiscoAnimation(viz, leds);
        looper->addInput(&input);
        looper->addVisualization(viz);
        looper->addAnimation(anim);
        currentAnimation = 2;
        break;
      case 2:
{'fraction_non_alphanumeric': 0.12828858150257663, 'fraction_numerical': 0.014103607268782207, 'mean_word_length': 3.7342747111681645, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5427649', 'n_tokens_mistral': 1337, 'n_tokens_neox': 1279, 'n_words': 294}