示例#1
0
def show_channel(val1, val2, val3, val4, val5, val6, val7, val8):
    global chan_temp
    for k in range(0, 8):
        if k == 0:
            chan_temp = val1
        elif k == 1:
            chan_temp = val2
        elif k == 2:
            chan_temp = val3
        elif k == 3:
            chan_temp = val4
        elif k == 4:
            chan_temp = val5
        elif k == 5:
            chan_temp = val6
        elif k == 6:
            chan_temp = val7
        elif k == 7:
            chan_temp = val8
        for j in range(0, 2):
            for i in range(0, 16):
                oledFunc.oledfillarea(oledaddress, j, 1, i + k * 16, (i+1) + k * 16, chan_temp[i + j * 16])
示例#2
0
def show_volume():
    oledFunc.oledstr(oledaddress, 4, 4, 'Volume:')
    vol_l = 0x00    # 音量阶梯低位
    vol_h = 0x00    # 音量阶梯高位
    if RDA_reg_data[6] - 127:       # 减去基础大小
        for i in range(1, RDA_reg_data[6] - 126):
            if i < 9:
                vol_l = (vol_l >> 1) | 0x80
                oledFunc.oledfillarea(oledaddress, 5, 5, 60+i*4, 60+i*4 + 3, vol_l)
            else:
                vol_h = (vol_h >> 1) | 0x80
                oledFunc.oledfillarea(oledaddress, 5, 5, 60+i*4, 60+i*4 + 3, 0xff)
                oledFunc.oledfillarea(oledaddress, 4, 4, 60+i*4, 60+i*4 + 3, vol_h)
        for i in range(RDA_reg_data[6] - 126, 18):
            oledFunc.oledfillarea(oledaddress, 4, 5, 60+i*4, 60+i*4 + 3, 0x00)
示例#3
0
def show_channel(val1, val2, val3, val4, val5, val6, val7, val8):
    global chan_temp
    for k in range(0, 8):
        if k == 0:
            chan_temp = val1
        elif k == 1:
            chan_temp = val2
        elif k == 2:
            chan_temp = val3
        elif k == 3:
            chan_temp = val4
        elif k == 4:
            chan_temp = val5
        elif k == 5:
            chan_temp = val6
        elif k == 6:
            chan_temp = val7
        elif k == 7:
            chan_temp = val8
        for j in range(0, 2):
            for i in range(0, 16):
                oledFunc.oledfillarea(oledaddress, j, 1, i + k * 16,
                                      (i + 1) + k * 16, chan_temp[i + j * 16])
示例#4
0
def show_volume():
    oledFunc.oledstr(oledaddress, 4, 4, 'Volume:')
    vol_l = 0x00  # 音量阶梯低位
    vol_h = 0x00  # 音量阶梯高位
    if RDA_reg_data[6] - 127:  # 减去基础大小
        for i in range(1, RDA_reg_data[6] - 126):
            if i < 9:
                vol_l = (vol_l >> 1) | 0x80
                oledFunc.oledfillarea(oledaddress, 5, 5, 60 + i * 4,
                                      60 + i * 4 + 3, vol_l)
            else:
                vol_h = (vol_h >> 1) | 0x80
                oledFunc.oledfillarea(oledaddress, 5, 5, 60 + i * 4,
                                      60 + i * 4 + 3, 0xff)
                oledFunc.oledfillarea(oledaddress, 4, 4, 60 + i * 4,
                                      60 + i * 4 + 3, vol_h)
        for i in range(RDA_reg_data[6] - 126, 18):
            oledFunc.oledfillarea(oledaddress, 4, 5, 60 + i * 4,
                                  60 + i * 4 + 3, 0x00)