   
   double intensity = map(avgleft, 0, 700, 0, 100);
   
-  if (mode == PARTYMODE || mode == SLOW) {
+  if (mode == MODE_PARTY || mode == MODE_SLOW) {
     while (abs(led1Value-out) > 1.0 || abs(led2Value-out2) > 1.0 || abs(led3Value-out3) > 1.0 || abs(led4Value-out4) > 1.0) {
       globalRed = 0;
       globalBlue = 0;

    }
    Serial.println(out);
    lastUpdate = out;
  } else if(mode == OFF){
    rawWriteColor(0,0,0,0);
  }
  // Serial.println("RNNING");
}

#include <EEPROM.h>

#define MODE_OFF 0
#define MODE_PARTY 1
#define MODE_SLOW 2
#define MODE_GREENPULSE 3
#define MODE_MODE_WHITEPULSE 4
#define MODE_BASSFADE 5
#define MODE_GREEN 6
#define MODE_RED 7
#define MODE_WHITE 8

#define NUM_MODES 9

bool isChanging = false;
volatile unsigned long timer_start;
int mode = MODE_PARTY;
int strobe = 4; // strobe pins on digital 4
int res = 5; // reset pins on digital 5
int ledPin = 9;
