Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #====Pinout:=====
- # RST--RST
- # 2(D4)--CS(CE)
- #15(D8)--DC
- #13(D7)--MOSI(DIN)
- #14(D5)--SCK(CLK)
- # 3V3--VCC
- # GND--LED
- # GND--GND
- #
- #TEXT: 8 row x 21 col = 168 chars
- import ubinascii,time
- from machine import Pin,SoftSPI
- nce=Pin(2,Pin.OUT,value=1)
- ndc=Pin(15,Pin.OUT)
- spi=SoftSPI(baudrate=100000,sck=Pin(14),mosi=Pin(13),miso=Pin(12))
- time.sleep_ms(500)
- def ntxt(x):
- nce.off()
- ndc.off()
- spi.write(b'!\x14\xB2 \x0C@\x80')
- f=ubinascii.a2b_base64('IEwfTAhMRFQfNAgfYR5eTF5MHhBkDg4eEhJaZGBxDFUAYANfSBkqYEBRVUQQBAAYLnI5MQ43LiEqIkBQREpRIS4+Py4/Pz8uH3EIHx9fHi4/Lj8yYR8PHxsDOWADcSIQEPRFlP2mL3bBh2yig/HgZGLyEVWj9HTyk3WFjgYmMaoABRj6LpnlAIsDqyMCIQQZdYeVVfpNRR9VdQICilIiFbTyVYx0jQns+Y982YT4eXQRttFND/x8+tkfnY/BBxCE')
- ndc.on()
- for i in range(0,126):
- t,p=i//21%3*4,i+i//63*21
- p,q=ord(x[p])%96,ord(x[p+21])%96
- p,q,r,s=f[p],f[p+96],f[q],f[q+96]
- y=p&31|r<<6&192,p>>5|q<<2&28|r<<1&192,q>>3|s<<3&192,0,p>>2&7|r<<4&240,q&7|r>>1&48|s<<6&192,q>>5&7|s<<1&240,0,p>>4&1|r<<2&124,q>>2&1|r>>3&12|s<<4&112,q>>7&1|s>>1&124,0
- spi.write(bytes(y[t:t+4]))
- nce.on()
- ntxt((13*'Halo, dunia! ')[0:168])
Add Comment
Please, Sign In to add comment