Beispiel #1
0
 def run(self):
     self.connect()
     red = 0
     green = 0
     blue = 0
     while True:
         data = self.fetch_data()
         if 'color' in data:
             data = data.split()[1:]
             color = map(int, data)
             red, green, blue = color
         elif data == 'rainbow':
             LedLib.rainbow()
         elif data == 'fill':
             LedLib.fill(red, green, blue)
         elif data == 'blink':
             LedLib.blink(red, green, blue)
         elif data == 'chase':
             LedLib.chase(red, green, blue)
         elif data == 'wipe_to':
             LedLib.wipe_to(red, green, blue)
         elif data == 'fade_to':
             LedLib.fade_to(red, green, blue)
         elif data == 'run':
             LedLib.fade_to(red, green, blue)
         elif data == 'close':
             LedLib.off()
         time.sleep(0.001)
Beispiel #2
0
led.fade_to(255, 0, 0)

f.reach(1, 0.25, 1.2)
led.fade_to(0, 255, 0)

f.reach(1, 2.2, 1.2)
led.fade_to(0, 0, 255)

f.reach(0.25, 2.2, 1.2)
led.fade_to(255, 255, 0)

f.reach(0.25, 0.25, 1.2)
led.fade_to(255, 0, 0)

#center_spin
f.reach(0.7, 1.1, 1.5)
led.run(255, 0, 255, length=15, direction=True)
f.spin(yaw_rate=0.6)

led.blink(255, 0, 0)
f.attitude(2)

#Return t land pos
led.rainbow()
f.reach(0.25, 0.25, 1.2, delay=True)

led.chase(0, 255, 0)
f.land()
led.off()
time.sleep(3)
Beispiel #3
0
def _command_led_test(*args, **kwargs):
    LedLib.chase(255, 255, 255)
    time.sleep(2)
    LedLib.off()