Beispiel #1
0
class CanvasApp(App):

    def on_stop(self):
        self.pimp_my_ci.stop()

    def build(self):
        threading.Thread(target=self.start).start()
        return self.create_screen()

    def start(self):
        self.pimp_my_ci = PimpMyCi(self)
        self.pimp_my_ci.start()

    def create_screen(self):
        self.root = BoxLayout(spacing=SIZE)

        for i in range(32):
            led = Led()
            led.create(i)
            self.root.add_widget(led)

        return self.root

    @mainthread
    def fillOff(self):
        self.fillRGB(0, 0, 0, 0, 32)

    @mainthread
    def fillRGB(self, r, g, b, start=0, end=0):
        for i in range(start, end):
            led = self.root.children[i]
            led.update(r, g, b)
Beispiel #2
0
 def start(self):
     self.pimp_my_ci = PimpMyCi(self)
     self.pimp_my_ci.start()