Esempio n. 1
0
    def __init__(self, slot, host=None):
        """
        コンストラクタ
        """

        self.slot = slot
        self.comm = I2C
        self.host = host

        # アドレス
        self.i2c_addr = 0x20

        # tp00
        self.tp00 = Tp00(self.slot, self.comm, self.host)
        self.tp00.start()

        # ピンの設定
        send_data = []
        send_data.append(
            {"act": "w", "add": self.i2c_addr, "cmd": 0x00, "v": [0xFF]})
        send_data.append(
            {"act": "r", "add": self.i2c_addr, "cmd": 0x00, "len": 1})
        send_data.append(
            {"act": "w", "add": self.i2c_addr, "cmd": 0x01, "v": [0x0]})
        send_data.append(
            {"act": "r", "add": self.i2c_addr, "cmd": 0x01, "len": 1})
        self.tp00.send(json.dumps(send_data))

        # 初期化
        send_data = []
        for i in range(0, 8):
            cmd = 0x02 + i
            send_data.append(
                {"act": "w", "add": self.i2c_addr, "cmd": cmd, "v": [0x00]})
        self.tp00.send(json.dumps(send_data))
    def __init__(self, slot, host=None):
        """
        コンストラクタ
        """

        self.slot = slot
        self.comm = I2C
        self.host = host

        # アドレス
        self.i2c_addr = 0x53

        # tp00
        self.tp00 = Tp00(self.slot, self.comm, self.host)
        self.tp00.start()

        format = 0x00 | 0x08 | 0x0b

        send_data = []
        # set resolution + range
        send_data.append(
            {"act": "w", "add": self.i2c_addr, "cmd": 0x31, "v": [format]})
        # set measure bit
        send_data.append(
            {"act": "w", "add": self.i2c_addr, "cmd": 0x2d, "v": [0x08]})
        # set as bypass mode
        send_data.append(
            {"act": "w", "add": self.i2c_addr, "cmd": 0x38, "v": [0x80]})
        self.tp00.send(json.dumps(send_data))
Esempio n. 3
0
    def __init__(self, slot, host=None):
        """
        コンストラクタ
        """
        self.slot = slot
        self.comm = GPIO
        self.host = host

        # tp00経由にて通信
        self.tp00 = Tp00(self.slot, self.comm, self.host)
        self.tp00.start()
    def __init__(self, slot, host=None):
        """
        コンストラクタ
        """
        self.slot = slot
        self.comm = I2C
        self.host = host

        # アドレス
        self.i2c_addr_rgb = 0x62
        self.i2c_addr_text = 0x3e

        self.tp00 = Tp00(self.slot, self.comm, self.host)
        self.tp00.start()
Esempio n. 5
0
    def __init__(self, slot, host=None):
        """
        コンストラクタ
        """

        self.slot = slot
        self.comm = I2C
        self.host = host

        # アドレス
        self.i2c_addr = 0x23

        # tp00
        self.tp00 = Tp00(self.slot, self.comm, self.host)
        self.tp00.start()