 
 #define EMPTY_COMMAND_SUCCESS " "
 #define EMPTY_COMMAND_FAIL ""
+
+enum LightMode {
+  NONE, STATIC,CRUDE
+};
+
+const int crude_T = 5000;
+const int crude_I = 255/2;
+const float crude_Ts = 1.0/6 * crude_T;
+
+unsigned long lightModeStart = 0;
+LightMode lightMode = NONE;
 
 void setup() {
   pinMode(PIN_RED, OUTPUT);

    String command = Serial.readStringUntil('\n');

    String output = processCommand(command);
    if (output.length() > 1) {
      Serial.println("+" + command);
      if (output != EMPTY_COMMAND_SUCCESS)
        Serial.println(output);


    setColor(r, g, b);

    setLightMode(STATIC);

    return EMPTY_COMMAND_SUCCESS;
  } else if (command.equals("CRUDE_LIGHT")) {
    lightModeStart = millis();
    setLightMode(CRUDE);
    return EMPTY_COMMAND_SUCCESS;
  } else if (command.startsWith("VERSION")) {
    return FIRMWARE_VERSION;
  }

  return EMPTY_COMMAND_FAIL;
}

void setLightMode(LightMode mode) {
  lightMode = mode;
}

void setColor(int r, int g, int b) {
