     population--;
   }
   updatePopulationAndMoveCursor();
-  lcd.write("Have a nice day!");
+  lcd.setCursor(0, 1);
+  lcd.print("Have a nice day!");
 }
 
 void openDoor() { // only open the door if it wasn't already opened
   if (!doorOpen) {
-    lcd.setRGB(0, 255, 0);
+    lcd.setBacklight(0x7); // white backlight
+    lcd.setCursor(0, 1);
+    lcd.println("open              ");
     doorOpen = true;
   }
 }
 
 void closeDoor() { // only close the door if it wasn't already closed.
   if (doorOpen) {
-    lcd.setRGB(255, 255, 255);
+    lcd.setBacklight(0x7); // dark backlight
+    lcd.setCursor(0, 1);
+    lcd.println("closed              ");
     doorOpen = false;
   }
 }


  // check if it's time to read data and update the filter
  microsNow = micros();
  if (microsNow - microsPrevious >= microsPerReading) { // This condition is taken from the tutorial code -- it ensures updates happen at the right time
    float difference = measureYaw() - 180; // Normalize the measurement so that it starts from 0, since the initial angle is 180
    doorAngle = abs(difference); // Note that the abs function cannot have other operations inside of it.  This is apparently a problem with Arduino.  This line and the previous one have to be two separate operations, or this will bug up.

    if (doorAngle < OPEN_ANGLE) { // Door is closed
      closeDoor();
      printIfDebug("Door not open");
    } else if (microsNow - microsLastRead < microsBetweenReads) { // Door is open, a movement was recently detected, and we are waiting between movements; do not double count or re-record the last passing time because the person may still be passing through.
      printIfDebug("Movement Detected");
    } else { // Door is open, but a complete movement has not been discovered recently.
      openDoor();
      ping_1 = sonar_1.ping_cm();
      ping_2 = sonar_2.ping_cm();

NewPing sonar_1(TRIGGER_PIN_1, ECHO_PIN_1, MAX_DISTANCE);     // NewPing setup of closer sensor.
NewPing sonar_2(TRIGGER_PIN_2, ECHO_PIN_2, MAX_DISTANCE);     // NewPing setup of farther sensor.

// RGB_LCD from Adafruit
Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();

// MADGEWICK
// see https://www.arduino.cc/en/Tutorial/Genuino101CurieIMUOrientationVisualiser
