def main(): b = nxt.locator.find_one_brick() mc = MotCont(b) # mc.start() mc.cmd(3, 50, 720) light = Light(b, PORT_1) light.set_illuminated(True) # mc.stop() while True: try: print "Light sensor reading: ", light.get_sample() time.sleep(0.1) except KeyboardInterrupt: light.set_illuminated(False) sys.exit(1)
def __init__(self, sock): self.sock = sock self.lock = Lock() self.mc = MotCont(self)
def __init__(self): self.b = nxt.locator.find_one_brick() self.mc = MotCont(self.b)
def __init__(self): self.is_started = False self.is_stopped = True self.b = nxt.locator.find_one_brick() self.mc = MotCont(self.b)