Exemplo n.º 1
0
	def closeApp(self):
		print("Bye!")
		lcd.displayString("     (.)(.)     ", 1)
		lcd.displayString("      BYE!      ", 2)
		sleep(1)
		lcd.clear()
		lcd.backlight(0)
		return False
Exemplo n.º 2
0
	def showBlackScreen(self):
		lcd.backlight(0)
		self.state = 0
		return True
Exemplo n.º 3
0
		smogProcess = Thread(target=smogSource.updateSmogProcess)
		smogProcess.daemon = True
		smogProcess.start()

		weatherSource = weatherData(LOCATION)
		weatherProcess = Thread(target=weatherSource.updateWeatherProcess)
		weatherProcess.daemon = True
		weatherProcess.start()

		thSource = am2302(PIN_AM2302)
		thProcess = Thread(target=thSource.updateThProcess)
		thProcess.daemon = True
		thProcess.start()

		lcd = lcd(LCD_CHARINLINE)
		lcd.backlight(0)

		loggingProcess = Thread(target=loggingToGoogle, args=(GDOCS_OAUTH_JSON, GDOCS_SPREADSHEET_NAME, LOGGING_FREQUENCY, thSource, weatherSource, smogSource))
		loggingProcess.daemon = True
		loggingProcess.start()

		stateMachine = stateMachine()

		print("Meteo Station started!")
		while work:
			try:
				work = stateMachine.executeState()
			except:
				work = True

		loggingProcess.stop = True