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

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

/*
 * Heartbeat simulator
 * 
 * Shows a different hue and brightness based on accelerometer activity,
 * with the idea that low movement means colder and less bright colours,
 * with more movement turning it into warmer and brighter colours.
 * 
 * Credit to Ben Nolan for the heart beat LED logic.
 * And for lending me some Neopixels to play around with!
 */
 
#define BAUD_RATE 9600
#define NUM_LEDS_CH1 120
#define LED_PIN_CH1 4
#define NUM_LEDS_CH2 29
#define LED_PIN_CH2 2
#define ACCELX_PIN 0
#define ACCELY_PIN 2
#define ACCELZ_PIN 4
#define PULSE_PIN 0
#define BUTTON_PIN 6

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

// config
int staticBpm = 60; // in case no pulse is found
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;

void loopHeartRate() {
  offset = (offset + 1) % beatLength;

  if (pulseFound == true && pulseBpm <= maxBpm) {
    bpm = pulseBpm;
  } else {
    bpm = staticBpm;
