示例#1
0
 def __init__(self, sensor_table, srv):
     self.light_sensor = LightSensor()
     self.mutex = esp.mutex()
     self.sensor_table = sensor_table
     self.sensors = dict()
     self.task = esp.os_task(callback=lambda task: handler(task, srv, self))
     for sensor_name, sensor_port in sensor_table.items():
         self.sensors[sensor_name] = Sensor(sensor_name, sensor_port, 10000, task=self.task, mutex=self.mutex)
         pyb.udelay(10000)
 def __init__(self, sensor_table, srv):
     self.light_sensor = LightSensor()
     self.mutex = esp.mutex()
     self.sensor_table = sensor_table
     self.sensors = dict()
     self.task = esp.os_task(callback=lambda task: handler(task, srv, self))
     for sensor_name, sensor_port in sensor_table.items():
         self.sensors[sensor_name] = Sensor(sensor_name, sensor_port, 10000, task=self.task, mutex=self.mutex)
         pyb.udelay(10000)
示例#3
0
文件: tm3.py 项目: mianos/micropython
 def __init__(self):
     self.os_task = esp.os_task(callback=lambda tm: self.handler(tm))
     self.dqueues = dict()
     self.bhandler = ButtonHandler()
     self.wem = WifiEventManager()
示例#4
0
 def __init__(self):
     self.os_task = esp.os_task(callback=lambda tm: self.handler(tm))
     self.actions = dict()
示例#5
0
 def __init__(self):
     self.os_task = esp.os_task(callback=lambda tm: self.handler(tm))
     self.dqueues = dict()
     self.bhandler = ButtonHandler()
     self.wem = WifiEventManager()