示例#1
0
def cradle():
    ground = GroundBase()
    ground.parse_args()
    delay = 0.5
    while True:
        for x in range(1, 4):
            ground.set_nodes(set_color(x))
            time.sleep(delay)
        for x in range(3, 1, -1):
            ground.set_nodes(set_color(x))
            time.sleep(delay)
示例#2
0
def boom(node):
    ground = GroundBase()
    ground.parse_args()
    delay = 0.01
    while True:
        for i in range(1, 10):
            ground.set_nodes(red(node))
            time.sleep(1.0/i)
            ground.set_nodes(black(node))
            time.sleep(1.0/i)
        ground.set_nodes(ready(node))
        time.sleep(delay)
        ground.set_nodes(arm(node))
        time.sleep(delay)
        ground.set_nodes(fire(node))
        time.sleep(10)
示例#3
0
def main():
    ground = GroundBase()
    ground.parse_args()
    nodes = dict()
    degrees = 0

    frame_delay = 0.01
    while True:

        degrees += 1

        # Map each node to a closes
        for node_id in [1, 3, 2, 4]:
            nodes[node_id] = color(degrees + node_id * 15)
            ground.set_nodes(nodes)
            time.sleep(frame_delay)
示例#4
0
def main():
    ground = GroundBase()
    ground.parse_args()
    nodes = dict()
    packet_index = 0

    frame_delay = 0.1
    while True:
        packet_index += 1
        r = 255 if (packet_index % 8 >= 4) else 0
        g = 255 if (packet_index % 4 >= 2) else 0
        b = 255 if packet_index % 2 else 0
        a = 255

        # Map each node to a closes
        for node_id in range(6):
            nodes[node_id] = (r, g, b, a)
            ground.set_nodes(nodes)
            time.sleep(frame_delay)