Ejemplo n.º 1
0
    def __init__(self):
        self.page_now = 0

        self.ser = SerAction()

        self.page_back = 1

        self.connecting_page = ConnectingPage(0)
        self.choose_page = ChoosePage(1, self.__page_update)
        self.snack_page = Snacke(2, self.__page_update, self.page_back,
                                 self.ser)
        self.flappy_page = Flappy(3, self.__page_update, self.page_back,
                                  self.ser)
        self.pacman_page = Pacman(4, self.__page_update, self.page_back,
                                  self.ser)

        self.__setting()
        self.__page_update([self.page_now])
        self.page_switch()

        done()
Ejemplo n.º 2
0
from cuser import SerAction
import time


def hello(ser):
    print(ser[0].get_485_buffer())


def hi(ser):
    print(ser[0].send_485(0x20))


ser = SerAction()
ser.connection()

ser.listen_load('key1', hello, [ser])
ser.listen_load('key2', hi, [ser])
Ejemplo n.º 3
0
from cuser import SerAction
import time


def led(s):
    number = 1
    print(111)
    while number <= 128:
        s[0].set_led(number)
        number = number * 2
        time.sleep(0.1)

    s[0].set_led(0)


s = SerAction()
s.connection()
s.listen_load('vibrate', led, [s])
s.vibrate_start()
s.set_nixie('       ')
s.set_led(0)