LCD12864
--- LCD12864液晶屏关联功能函数¶
lcd12864
模块的主要功能与函数
功能相关函数¶
-
class
lcd12864_lib.
LCD12864
(rs, e)¶
创建一个LCD12864对象。
rs
引脚名称e
引脚名称
-
LCD12864.
qp_12864
()¶ 清屏函数,清除所有显示信息
-
LCD12864.
lcd_write_string
(address, string, s_bit)¶ 显示字符。
address
显示的起始地址(范围:80-87,90-97,88-8f,98-9f)string
显示的内容s_bit
1:非汉字 2:汉字
LCD12864与开发板接线对应引脚:¶
注意: PSB(串/并选择引脚)部分LCD12864是用电阻控制高低电平,接此线时需万用表量一下,如果是低电平,不可直接接5V,会短路。
TPYBoard LCD12864 GND GND VIN VCC Y4 RS GND R/W Y3 E X1 DB0 X2 DB1 X3 DB2 X4 DB3 X5 DB4 X6 DB5 X7 DB6 X8 DB7 5V PSB 5V BLA GND BLK
程序示例:¶
# main.py -- put your code here!
import pyb
import lcd12864_lib from LCD12864
def main():
lcd=LCD12864(rs='Y4',e='Y3') #设置LCD12864功能引脚
lcd.lcd_write_string(0x82,"MicroPyton",1)
lcd.lcd_write_string(0x91,"By TurnipSmart",1)
lcd.lcd_write_string(0x8a,"萝卜电子",2)
lcd.lcd_write_string(0x9a,"液晶测试 ",2)
if __name__ == '__main__':
main()