Пример #1
0
 def setUp(self):
     #logging.basicConfig(level=logging.INFO)
     #random.seed("WSlice")
     self.ws = ws = WS2812(1, 64)
     for i in range(len(ws)):
         ws[i] = (i, 2 * i, 3 * i)
     self.p = Percolator(ws)
Пример #2
0
    def __init__(self, write_fun=None, config={}):
        self.config = config

        if write_fun is None:

            @coroutine
            def write(self, *args):
                print(*args)

            self.write = write
        else:
            self.write = write_fun

        self.act_led = pyb.LED(3)
        self.err_led = pyb.LED(1)
        self.pkt_led = pyb.LED(2)

        self.pots = [0] * 4

        self.percolator = \
                Percolator(WS2812(spi_bus=config['leds'].get('spi'),
                                  led_count=config['leds'].get('qty')))
        self.percolator.bingo = self.bingo

        self.ws_rings = WS2812(2, 2 * 7 + 45)
        self.ring_lights = Lights(self.ws_rings)

        self.feed_rollers = [
            Jewel7(lights=self.ring_lights[0:7]),
            Jewel7(lights=self.ring_lights[7:14])
        ]

        self.rr = RingRamp(lights=self.ring_lights[14:],
                           circumference=60, \
                           bottom=7, \
                           g=-40.0,
                           ball_check_fun = self.ball_check)

        #        self.zap_balls = False
        self.set_brightness(31)