TA的每日心情 | 奋斗 2025-2-2 23:57 |
---|
签到天数: 2087 天 [LV.Master]伴坛终老
|
楼主 |
发表于 2020-3-1 16:07
|
显示全部楼层
本帖最后由 xyz123123 于 2020-3-1 23:15 编辑
HD44780每行的显存是40个字符,1602屏每行只可显示16个字符。
屏幕滚动的功能似乎没什么用,估计不太会用它去做滚动广告、屏保之类的吧。对显示效果要求不高,一般也不会去搞两屏内容快速切换。
因此写几个常用的功能就够。
- void LcdLocate(int8u row, int8u col); //指定字符显示位置。
- void LcdPrint(int8u c); //显示一个字符。
- void LcdPrintString(int8u row, int8u col, int8u *str); //依次显示str中的字符,直至'\0'。不考虑超出16列、换行之类的。
- void LcdClearRow(int8u row); //其实就是从行首位置起显示16个空格。
复制代码
例如,程序初始的界面:
- LcdInit();
- LcdPrintString(1, 1, " Spot Welder");
- LcdPrintString(2, 1, " 2020-02");
复制代码
|
|