def __init__(self,screen,leds,cardReader,emergencyStopButton,buzzer,relay):
		# Store the hardware.
		self.screen = screen
		self.leds = leds
		self.cardReader = cardReader
		self.emergencyStopButton = emergencyStopButton
		self.buzzer = buzzer
		self.relay = relay

		# Set up the observers.
		self.cardReader.register(CardReaderObserver(self))
		self.emergencyStopButton.register(EmergencyStopButtonObserver(self))
		StateManager.register(StateObserver(self))
		SessionManager.register(SessionObserver(self))
		MessageManager.register(MessageObserver(self))
		StateManager.staticStateManager.states["ToggleAccessType"].register(AccessTypeStateChanges(self))

		# Send the initial state for the e-stop.
		if self.emergencyStopButton.isPressed():
			StateManager.emergencyStopButtonPressed()
		else:
			StateManager.emergencyStopButtonReleased()

		# Set up the rest of the initial states.
		self.currentSession = None
		self.stateChanged(StateManager.getState())
		self.sessionChanged(None)
		self.messageChanged("")

		# Set up the timer threads.
		self.sessionTimerThread = SessionTimer(self)
		self.sessionTimerThread.start()
	def emergencyStopChanged(self,pressed):
		if pressed:
			StateManager.emergencyStopButtonPressed()
		else:
			StateManager.emergencyStopButtonReleased()