示例#1
0
def show(y, x, string, addr):
    if isinstance(string, bytes):
        _exe(addr, b'DisplayGB2312,%d,%d,' % (y, x) + string[:16])
    else:
        string = str(string)[:16]
        _exe(addr, b'DisplayGB2312,%d,%d,%s' % (y, x, string))
    sleep(len(string))
示例#2
0
def temp_humi(addr):
    res = _exe(addr, b'get_temp_humi', 2)
    if res == None:
        return None, None
    t, h = res // 256, res % 256
    if t >= 128: t -= 256
    return t, h
示例#3
0
def time(addr):
    t = _exe(addr, b'getT', 6, 1)
    try:
        for i in range(6):
            _[i] = t[i] - 1
        return tuple(_)
    except:
        pass
示例#4
0
def value(addr):
	return _exe(addr,b'get_mic_val',2)
示例#5
0
def set_time(Y, M, D, h, m, s, addr):
    _exe(addr, b"setT%c%c%c%c%c%c" % (Y, M, D, h, m, s))
示例#6
0
def get(addr):
    return _exe(addr, b'get_touch', 1)
示例#7
0
def clear(addr):
    _exe(addr, b'ClearScreen')
    sleep(15)
示例#8
0
def values(addr):
    data = _exe(addr, b'get_key_val', 9, True)
    try:
        return conv(data)
    except:
        return None, None
示例#9
0
def get_voice_id(addr):
    return _exe(addr, b'get_command', 1)
示例#10
0
def off(addr):
    _exe(addr, b'set_led_off')
示例#11
0
def on(addr):
    _exe(addr, b'set_led_on')
示例#12
0
def value(addr):
	return _exe(addr,b'get_light_val',2)
示例#13
0
def value(addr):
    return _exe(addr, b'get_poten_val', 2)
示例#14
0
def humi(addr):
    return _exe(addr, b'get_humi', 1)
示例#15
0
def temp(addr):
    return _exe(addr, b'get_temp', 1)
示例#16
0
def value(addr):
    return _exe(addr, b'get_distance_val', 2)