您好,登錄后才能下訂單哦!
這篇文章主要介紹“Python的TPYBoard驅動LCD5110腳本怎么寫”的相關知識,小編通過實際案例向大家展示操作過程,操作方法簡單快捷,實用性強,希望這篇“Python的TPYBoard驅動LCD5110腳本怎么寫”文章能幫助大家解決問題。
MicroPython的TPYBoard驅動LCD5110,
先看一下LCD5110針腳含義吧(注意:LCD5110的針腳有些不一樣的)
TPYBoard的針腳與5110的針腳對應關系如下:
TPYBoard LCD5110 memo
————————————————————————————
# any Pin => RST Reset pin (0=reset, 1=normal)
# any Pin => CE Chip Enable (0=listen for input, 1=ignore input)
# any Pin => DC Data/Command (0=commands, 1=data)
# MOSI => DIN data flow (Master out, Slave in)
# SCK => CLK SPI clock
# 3V3 or any Pin => VCC 3.3V logic voltage (0=off, 1=on)
# any Pin => LIGHT Light (0=on, 1=off)
# GND => GND
還是看不明白的話,直接上針腳編號吧
TPYBoard LCD5110 memo
————————————————————————————
Y10 => RST Reset pin (0=reset, 1=normal)
Y11 => CE Chip Enable (0=listen for input, 1=ignore input)
Y9 => DC Data/Command (0=commands, 1=data)
X8 => DIN data flow (Master out, Slave in)
X6 => CLK SPI clock
VCC
Y12 => LIGHT Light (0=on, 1=off)
GND
接線ok后,可運行main.py了。
main.py源代碼:
import pyb import upcd8544 from machine import SPI,Pin def main(): SPI = pyb.SPI(1) #DIN=>X8-MOSI/CLK=>X6-SCK #DIN =>SPI(1).MOSI 'X8' data flow (Master out, Slave in) #CLK =>SPI(1).SCK 'X6' SPI clock RST = pyb.Pin('Y10') CE = pyb.Pin('Y11') DC = pyb.Pin('Y9') LIGHT = pyb.Pin('Y12') lcd_5110 = upcd8544.PCD8544(SPI, RST, CE, DC, LIGHT) lcd_5110.lcd_write_string('Hello Python!',0,0) lcd_5110.lcd_write_string('Micropython',6,1) lcd_5110.lcd_write_string('TPYBoard',12,2) lcd_5110.lcd_write_string('v102',60,3) lcd_5110.lcd_write_string('This is a test of LCD5110',0,4) if __name__ == '__main__': main()
關于“Python的TPYBoard驅動LCD5110腳本怎么寫”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識,可以關注億速云行業資訊頻道,小編每天都會為大家更新不同的知識點。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。