Ejemplo n.º 1
0
def wakeMode():
	global endTime
	global duration
	#adjust end time
	endTime = datetime.datetime.now() + datetime.timedelta(minutes=duration)
	
	#print "wakemode entered. Now:",datetime.datetime.now()," Endtime:",endTime
	while datetime.datetime.now() < endTime:
		tubeFunctions.ledStatus(True)
		loopDigits(1,1)
	
	tubeFunctions.ledStatus(False)
	tubeFunctions.off()
	#print "leaving wakemode. Time is now",datetime.datetime.now()
	updateTime.updateTime()
Ejemplo n.º 2
0
import RPi.GPIO as GPIO
import time
import datetime
import tubeFunctions
import updateTime

GPIO.setmode(GPIO.BCM)
GPIO.setup(25, GPIO.IN, pull_up_down=GPIO.PUD_UP)

tubeFunctions.off()
tubeFunctions.ledStatus(False)

#set the end time for wakemode
endTime = datetime.datetime.now()

#wake mode duration in minutes
duration = 20

#enters wake Mode. Cycles through digits until time expires or more movement is detected
def wakeMode():
	global endTime
	global duration
	#adjust end time
	endTime = datetime.datetime.now() + datetime.timedelta(minutes=duration)
	
	#print "wakemode entered. Now:",datetime.datetime.now()," Endtime:",endTime
	while datetime.datetime.now() < endTime:
		tubeFunctions.ledStatus(True)
		loopDigits(1,1)
	
	tubeFunctions.ledStatus(False)