     sensorRising = true;
   }  
   sensorThen = sensorNow;
+  
+   /*
+   * Check for a rising edge on the safety sensor.
+   */
+  boolean safetyRising = false;
+  int safetyNow = digitalRead(SENSOR_2_PIN);
+  if (safetyNow != safetyThen && safetyNow)
+  {
+    //Sensor rising edge!
+    Serial.println("Safety rising edge.");
+    safetyRising = true;
+  }  
+  safetyThen = safetyNow;
 
 
   /*

      digitalWrite(BLENDER_PIN, HIGH);
      timerStart = now; 
    }
    else if (buttonPushed)
    {
      Serial.println("Pausing...");
      currentState = S_PAUSED;

  currentState = S_WARMING_UP;
  buttonThen = 0;
  sensorThen = 0;
  safetyThen =0;
}


