from machine import Pin import time # 输出存储器锁存时钟线 ST_CP = Pin(21, Pin.OUT) # 数据输入时钟线 SH_CP = Pin(22, Pin.OUT) # 串行数据输入 DS = Pin(5, Pin.OUT) data=[1,0,0,0,1,1,0,0] ST_CP.off() length=len(data) data_tmp=[] for i in range(length-1,-1,-1): data_tmp.append(data[i]) DS.value(data[i]) SH_CP.off() SH_CP.on() print(data_tmp) # [0, 0, 1, 1, 0, 0, 0, 1] , 从后往前输出data ST_CP.on() time.sleep(5)