 void loopHeartRate() {
   offset = (offset + 1) % beatLength;
 
-//  serialOutput();
   if (pulseFound == true && pulseBpm <= maxBpm) {
-//    serialOutputWhenBeatHappens();
     bpm = pulseBpm;
   } else {
     bpm = staticBpm;

  bpm = staticBpm;
  
  if (pulseBeatFound == true){
//    offset = 0;
//    serialOutputWhenBeatHappens();
//    Serial.println(bpm);
    pulseBeatFound = false;
  }


#include "FastLED.h"
#include <EEPROM.h>

// Digital PINs
#define LED_PIN_CH1 4
#define LED_PIN_CH2 2
#define MODE_BUTTON_PIN 6
#define BRIGHTNESS_BUTTON_PIN 8
#define BEAT_BUTTON_PIN 10

// Analog PINs
#define ACCELX_PIN 0
#define ACCELY_PIN 2
#define ACCELZ_PIN 4

// Other constants
#define BAUD_RATE 9600
#define NUM_LEDS_CH1 120
#define NUM_LEDS_CH2 29
#define FRAMES_PER_SECOND 30

// ui
int mode = 1;
int modeCount = 4;
Bounce modeButton;

// config
int staticBpm = 60; // in case no pulse is found
int pulseBpm = 0; // actually detected value
int maxBpm = 180; // avoids the system going crazy
byte beat[]  = {2,2,2,2,3,4,3,2,1,0,10,2,2,3,4,6,8,5,3,3,3,3}; // From http://ecg.utah.edu/img/items/Normal%2012_Lead%20ECG.jpg
byte beatLength = 22;
