 
 }
 
-void deleteme() {
-  int a = 1;
-}
-
 void loop() {
-  Serial.println("Top of loop");
+  //Serial.println("Top of loop");
   if (CircuitPlayground.rightButton()) {
     debug("Right");
   }

const uint8_t OLED_RESET = 6;   // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);


//// MenuSystem

class MyRenderer : public MenuComponentRenderer {
  public:
    void render(Menu const& menu) const {
      oled.clearDisplay();
      oled.setCursor(0, 0);
      Serial.print("Displaying menu");
      Serial.println(menu.get_name());

      if (menu.get_name() == "") {
        oled.println("Main Menu");
      } else {
        oled.println(menu.get_name());
      }

      for (int i = 0; i < menu.get_num_components(); ++i) {
        MenuComponent const* cp_m_comp = menu.get_menu_component(i);
        if (cp_m_comp->is_current()) {
          oled.print(">");
        } else {
          oled.print(" ");
        }
        cp_m_comp->render(*this);

        oled.println("");
      }
      Serial.println("Displaying menu");
      oled.display();
    }

    void render_menu_item(MenuItem const& menu_item) const {
      Serial.print("Rendering menu item ");
      Serial.println(menu_item.get_name());
      oled.print(menu_item.get_name());
    }

    void render_back_menu_item(BackMenuItem const& menu_item) const {
      oled.print(menu_item.get_name());
    }

    void render_numeric_menu_item(NumericMenuItem const& menu_item) const {
      Serial.print("Rendering menu item");
      Serial.println(menu_item.get_name());
      oled.print(menu_item.get_name());
    }

    void render_menu(Menu const& menu) const {
      oled.print(menu.get_name());
    }
};

void mainMenuHandler(MenuComponent* p_menu_component) {
  Serial.print("[");
  Serial.print(p_menu_component->get_name());
  Serial.println("] selected");
  oled.clearDisplay();
  oled.setCursor(0, 0);
  oled.print("[");
  oled.print(p_menu_component->get_name());
  oled.print("] selected");
  delay(1500);
}

MyRenderer menuRenderer;
MenuSystem menuSystem(menuRenderer);

MenuItem mmSensors("Sensors", &mainMenuHandler);
MenuItem mmAnimations("Animations", &mainMenuHandler);
MenuItem mmSetup("Setup", &mainMenuHandler);

//// Operations
boolean DEBUG_MODE = true;

////-------------------------------------------------------------------- Functions
boolean isCapPressed(uint8_t capNum) {
  int capValue = CircuitPlayground.readCap(capNum, 30);
  if ( capValue > CAP_THRESHOLD) {

  }
  Serial.println("Initialized oled");


  // Build the menus
  menuSystem.get_root_menu().add_menu(&mmSensorsMenu);
  menuSystem.get_root_menu().add_menu(&mmAnimMenu);
  menuSystem.get_root_menu().add_menu(&mmSetupMenu);

  mmSensorsMenu.add_item(&sensorLight);
  mmSensorsMenu.add_item(&sensorSound);

  mmAnimMenu.add_item(&animDemo);
  mmAnimMenu.add_item(&animLight);

  mmSetupMenu.add_item(&setupSenseUp);
  mmSetupMenu.add_item(&setupSenseDown);
  mmSetupMenu.add_item(&setupDebugOn);
  mmSetupMenu.add_item(&setupDebugOff);

  currentActivity = &blinkActivity;


  Serial.println("Starting");
  //Serial.print("Debug is ");
