Example #1
0
    def build(self):
        # Build child 'window' from class 'Window'.
        window = Window()
        window.build()
        # Set 'window' framerate with constant FPS.
        Clock.schedule_interval(window.render, 1 / FPS)
        # At app initiation call 'launchBall()'.
        window.launchBall()

        return window
Example #2
0
 def build(self):
     self.title = "Calculator"
     return Window()
Example #3
0
 def build(self):
     return Window()
Example #4
0
    def dcLeft(self, port):
        ser = serial.Serial(port, baudrate=9600, timeout=1500)
        ser.write(struct.pack('>B', 4))
        ser.close()

    def dcRight(self, port):
        ser = serial.Serial(port, baudrate=9600, timeout=1500)
        ser.write(struct.pack('>B', 5))
        ser.close()

    def steppLeft(self, port):
        ser = serial.Serial(port, baudrate=9600, timeout=1500)
        ser.write(struct.pack('>B', 6))
        ser.close()

    def steppRight(self, port):
        ser = serial.Serial(port, baudrate=9600, timeout=1500)
        ser.write(struct.pack('>B', 7))
        ser.close()


class Window(App):
    def build(self):
        return MyWidget()


if __name__ == "__main__":
    window = Window()
    window.run()