def __init__(self, disp, draw): self.disp = disp self.draw = draw self.nextUpdate = get_current_time() self.nextBlink = get_current_time() + self.blinkTime self.verticalUpdate = get_current_time() +self.verticalScrollTime self.origin.append('Surfers Paradise, QLD') self.destination.append('Queensland University of Technology') self.routes = google.get_directions(self.origin[self.selectedRoute],self.destination[self.selectedRoute],'transit') PTCGPIO.setup(ledMap,buttonMap) self.buttonStates = [False] * len(buttonMap) self.clearScreen() self.alarm = Alarm.Alarm() self.alarm.setAlarmEpoch(google.departure_time_val(self.routes[self.selectedRoute]))
def getRoutes(self): self.routes = [] self.routes.append(google.get_directions(self.origin,self.destination[self.selectedDestination],'transit',self.arrivalTime)[0]) self.routes += google.get_directions(self.origin,self.destination[self.selectedDestination],'transit')
def updateList(self): if(timeCheck(self.nextUpdate)): self.routes = google.get_directions(self.route[self.selectedRoute],self.destination[self.selectedRoute],'transit') self.nextUpdate = get_current_time() + self.updateTime self.clearScreen() self.drawList()